Skip to content

Commit 1c23ea5

Browse files
committed
test: fix bitcoind already running warnings on macOS
On macOS, pidof installed via brew returns b'' rather than None. Account for this, to remove spurious warnings from the test_runner.
1 parent b90dad5 commit 1c23ea5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/test_runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,10 @@ def main():
364364
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):
365365
args = args or []
366366

367-
# Warn if bitcoind is already running (unix only)
367+
# Warn if bitcoind is already running
368+
# pidof might fail or return an empty string if bitcoind is not running
368369
try:
369-
if subprocess.check_output(["pidof", "bitcoind"]) is not None:
370+
if subprocess.check_output(["pidof", "bitcoind"]) not in [b'']:
370371
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]))
371372
except (OSError, subprocess.SubprocessError):
372373
pass

0 commit comments

Comments
 (0)