From b832ffe04468762f94c6b8a3efb2a978bd16e52e Mon Sep 17 00:00:00 2001 From: tdb3 <106488469+tdb3@users.noreply.github.com> Date: Wed, 28 Aug 2024 07:57:59 -0400 Subject: [PATCH] refactor: introduce default pid file name constant in tests --- test/functional/feature_filelock.py | 7 +++++-- test/functional/test_framework/test_node.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/functional/feature_filelock.py b/test/functional/feature_filelock.py index e71871114d3..79d2f65164b 100755 --- a/test/functional/feature_filelock.py +++ b/test/functional/feature_filelock.py @@ -7,7 +7,10 @@ import string from test_framework.test_framework import BitcoinTestFramework -from test_framework.test_node import ErrorMatch +from test_framework.test_node import ( + BITCOIN_PID_FILENAME_DEFAULT, + ErrorMatch, +) class FilelockTest(BitcoinTestFramework): def add_options(self, parser): @@ -33,7 +36,7 @@ def run_test(self): self.log.info("Check that cookie and PID file are not deleted when attempting to start a second bitcoind using the same datadir") cookie_file = datadir / ".cookie" assert cookie_file.exists() # should not be deleted during the second bitcoind instance shutdown - pid_file = datadir / "bitcoind.pid" + pid_file = datadir / BITCOIN_PID_FILENAME_DEFAULT assert pid_file.exists() if self.is_wallet_compiled(): diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 60ca9269a5b..e59ff4e3925 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -48,6 +48,7 @@ NUM_XOR_BYTES = 8 # The null blocks key (all 0s) NULL_BLK_XOR_KEY = bytes([0] * NUM_XOR_BYTES) +BITCOIN_PID_FILENAME_DEFAULT = "bitcoind.pid" class FailedToStartError(Exception):