Skip to content

Commit

Permalink
test: fix bitcoind already running warnings on macOS
Browse files Browse the repository at this point in the history
On macOS, pidof installed via brew returns b'' rather than None.
Account for this, to remove spurious warnings from the test_runner.

Github-Pull: bitcoin#17488
Rebased-From: 1c23ea5
  • Loading branch information
fanquake committed Jan 4, 2020
1 parent 5276b0e commit c0dc728
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/functional/test_runner.py
Expand Up @@ -361,9 +361,10 @@ def main():
def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False, runs_ci, use_term_control):
args = args or []

# Warn if bitcoind is already running (unix only)
# Warn if bitcoind is already running
# pidof might fail or return an empty string if bitcoind is not running
try:
if subprocess.check_output(["pidof", "bitcoind"]) is not None:
if subprocess.check_output(["pidof", "bitcoind"]) not in [b'']:
print("%sWARNING!%s There is already a bitcoind process running on this system. Tests may fail unexpectedly due to resource contention!" % (BOLD[1], BOLD[0]))
except (OSError, subprocess.SubprocessError):
pass
Expand Down

0 comments on commit c0dc728

Please sign in to comment.