bitcoin icon indicating copy to clipboard operation
bitcoin copied to clipboard

test: add test for specifying custom pidfile via `-pid`

Open theStack opened this issue 1 year ago • 4 comments

This small PR adds test coverage for the -pid command line option, which allows to overrule the pid filename (bitcoind.pid by default). One can specify either a relative path (within the datadir) or an absolute one; the latter is tested using self.options.tmpdir. Note that the functional test file feature_init.py so far only contained a stress test; with this new sub-test added, both the description and the test name are adapted to be more generic.

theStack avatar Aug 27 '24 12:08 theStack

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK tdb3, ryanofsky, naiyoma, achow101

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

DrahtBot avatar Aug 27 '24 12:08 DrahtBot

Concept ACK +1 on the suggestion above to move BITCOIN_PID_FILENAME_DEFAULT and import it in both files.

This is out of scope for this PR, so feel free to ignore. it would be good to add an edge case to test starting a node when there's already a pre-existing PID file.

naiyoma avatar Sep 07 '24 19:09 naiyoma

@tdb3:

"bitcoind.pid" is also mentioned in feature_filelock.py. Could add a commit that deduplicates this.

Created an example commit here: tdb3@b622390

Thanks! I've cherry-picked your commit, but reordered it to appear before the test introduction commit and changed the commit subject accordingly (introduce constant, instead of deduplicating). Let me know if that's okay for you.

@naiyoma:

This is out of scope for this PR, so feel free to ignore. it would be good to add an edge case to test starting a node when there's already a pre-existing PID file.

Good idea. I decided to leave that for a follow-up, happy to review if someone opens a PR.

theStack avatar Sep 23 '24 10:09 theStack

Thanks! I've cherry-picked your commit, but reordered it to appear before the test introduction commit and changed the commit subject accordingly (introduce constant, instead of deduplicating). Let me know if that's okay for you.

Looks great, thanks.

tdb3 avatar Sep 23 '24 16:09 tdb3

ACK 04e4d52420a0e6bf40d4bd6fe1f31f66db9eab0a

achow101 avatar Oct 23 '24 21:10 achow101