Skip to content

Commit

Permalink
ccmlib/node.py: _do_run_nodetool(): filter out debug-mode warnings fr…
Browse files Browse the repository at this point in the history
…om stderr

These messages are printed by seastar and ASAN respectively and they
trigger tests which look for error messages in stderr. Filter them out
to address this problem at the root, instead of dealing with it in each
individual test.
  • Loading branch information
denesb authored and fruch committed Apr 2, 2024
1 parent 25d34c9 commit cdf7ae6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion ccmlib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,22 @@ def _do_run_nodetool(self, nodetool, capture_output=True, wait=True, timeout=Non
if exit_status != 0:
raise NodetoolError(" ".join(nodetool), exit_status, stdout, stderr)

return stdout, stderr
ignored_patterns = (re.compile("WARNING: debug mode. Not for benchmarking or production"),
re.compile("==[0-9]+==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!"))

def keep(line):
self.debug(f"checking {line}")
for ignored_pattern in ignored_patterns:
if ignored_pattern.fullmatch(line):
return False
return True

def filter_debug_errors(stderr):
if stderr is None:
return stderr
return '\n'.join([line for line in stderr.split('\n') if keep(line)])

return stdout, filter_debug_errors(stderr)

def nodetool(self, cmd, capture_output=True, wait=True, timeout=None, verbose=True):
"""
Expand Down

0 comments on commit cdf7ae6

Please sign in to comment.