Skip to content

Commit

Permalink
Problem: jemalloc warning message mess-up test logic
Browse files Browse the repository at this point in the history
Solution:
- filter then from the cli stdout
  • Loading branch information
yihuang committed Jun 21, 2024
1 parent 903b590 commit d954723
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion testground/benchmark/benchmark/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ def __init__(self, cmd):
def raw(self, *args, stdin=None, stderr=subprocess.STDOUT, **kwargs):
"execute the command"
args = " ".join(build_cli_args_safe(*args, **kwargs))
return interact(
stdout = interact(
f"{self.cmd} {args}", input=stdin, stderr=stderr, env=os.environ
)

# filter out "<jemalloc>:" warning messages
stdout = "\n".join(
line for line in stdout.splitlines() if not line.startswith("<jemalloc>:")
)

return stdout

def __call__(self, *args, **kwargs):
"execute the command and clean the output"
return self.raw(*args, **kwargs).decode().strip()
Expand Down

0 comments on commit d954723

Please sign in to comment.