Skip to content

Conversation

mzumsande
Copy link
Contributor

@mzumsande mzumsande commented Apr 29, 2022

In #24789, I forgot to stop the node before using assert_start_raises_init_error in feature_coinstatsindex. This resulted in a bitcoind process that is not being terminated after the test finishes.
feature_prune has the same problem and also creates a zombie bitcoind process.

Also adds an assert to assert_start_raises_init_error to make sure the node isn't already running to prevent this sort of mistake in the future.

...in feature_coinstatsindex and feature_pruning.
Also add an assert to assert_start_raises_init_error that the node is
not already running.
@mzumsande mzumsande force-pushed the 20224_coinstatsindex_fix branch from c6c766a to a3cd7db Compare April 29, 2022 20:55
@mzumsande mzumsande changed the title test: add missing stop_node call to feature_coinstatsindex test: add missing stop_node calls to feature_coinstatsindex and feature_prune Apr 29, 2022
@mzumsande
Copy link
Contributor Author

An alternative fix would be to have assert_start_raises_init_error stop the node before starting it again (instead of asserting).

@brunoerg
Copy link
Contributor

I noticed there are other tests which don't stop the node before assert_start_raises_init_error, should we update all of them?

@mzumsande
Copy link
Contributor Author

I noticed there are other tests which don't stop the node before assert_start_raises_init_error, should we update all of them?

Which ones? Since I added the assert to assert_start_raises_init_error, I would expect these tests to assert now.
I'm not sure - on the one hand it might be easier to let assert_start_raises_init_error just stop the node, on the other hand I think it would be clearer if it's visible in the actual test when a node is stopped.

Oh, and thanks @willcl-ark I for finding this bug!

@brunoerg
Copy link
Contributor

Which ones?
Sorry, my bad! With these changes, I think all the tests are right. I thought it was missing intest_invalid_command_line_options (feature_config_args) but in the end of the previous function it stops the node.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

self.nodes[1].assert_start_raises_init_error(
expected_msg='Error: -reindex-chainstate option is not compatible with -coinstatsindex. '
'Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
extra_args=['-coinstatsindex', '-reindex-chainstate'],
)
self.restart_node(1, extra_args=["-coinstatsindex"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default extra args are persisted in node, so no need to pass them here again.

@maflcko maflcko merged commit becea48 into bitcoin:master Apr 30, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 30, 2022
@bitcoin bitcoin deleted a comment from Mireyavs May 2, 2022
@mzumsande mzumsande deleted the 20224_coinstatsindex_fix branch May 19, 2022 13:26
@bitcoin bitcoin locked and limited conversation to collaborators May 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants