aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-11-15 11:38:27 -0500
committerfanquake <fanquake@gmail.com>2020-01-04 18:50:43 +0800
commitc0dc7282068b370591e89c630c44bc43bbae38a5 (patch)
tree8622214ff6d2b37bbe38c1e41813b43ab6f9846b
parent5276b0e5a2e2a12c7e038a44847fe79d7afc2944 (diff)
downloadbitcoin-c0dc7282068b370591e89c630c44bc43bbae38a5.tar.xz
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. Github-Pull: #17488 Rebased-From: 1c23ea5fe67b88fd72a1ff640dd1bbb21a34fbf4
-rwxr-xr-xtest/functional/test_runner.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 9c92091f1d..2f8279bc21 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -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