Skip to content

Commit

Permalink
refactor: introduce default pid file name constant in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tdb3 authored and theStack committed Sep 23, 2024
1 parent 33adc75 commit b832ffe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/functional/feature_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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():
Expand Down
1 change: 1 addition & 0 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b832ffe

Please sign in to comment.