test: add missing stop_node calls to feature_coinstatsindex and feature_prune #25034

pull mzumsande wants to merge 1 commits into bitcoin:master from mzumsande:20224_coinstatsindex_fix changing 3 files +4 −0
  1. mzumsande commented at 7:48 PM on April 29, 2022: contributor

    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.

  2. mzumsande cross-referenced this on Apr 29, 2022 from issue [kernel 2a/n] Split hashing/index `GetUTXOStats` codepaths, decouple from `coinstatsindex` by dongcarl
  3. mzumsande force-pushed on Apr 29, 2022
  4. DrahtBot added the label Tests on Apr 29, 2022
  5. test: stop node before calling assert_start_raises_init_error
    ...in feature_coinstatsindex and feature_pruning.
    Also add an assert to assert_start_raises_init_error that the node is
    not already running.
    a3cd7dbfd8
  6. mzumsande force-pushed on Apr 29, 2022
  7. mzumsande renamed this:
    test: add missing stop_node call to feature_coinstatsindex
    test: add missing stop_node calls to feature_coinstatsindex and feature_prune
    on Apr 29, 2022
  8. mzumsande commented at 9:06 PM on April 29, 2022: contributor

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

  9. brunoerg commented at 9:46 PM on April 29, 2022: 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?

  10. mzumsande commented at 10:17 PM on April 29, 2022: 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?

    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!

  11. brunoerg commented at 10:44 PM on April 29, 2022: 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.

  12. in test/functional/feature_coinstatsindex.py:240 in a3cd7dbfd8
     235 |          self.nodes[1].assert_start_raises_init_error(
     236 |              expected_msg='Error: -reindex-chainstate option is not compatible with -coinstatsindex. '
     237 |              'Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
     238 |              extra_args=['-coinstatsindex', '-reindex-chainstate'],
     239 |          )
     240 | +        self.restart_node(1, extra_args=["-coinstatsindex"])
    


    MarcoFalke commented at 6:35 AM on April 30, 2022:

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

  13. MarcoFalke approved
  14. MarcoFalke commented at 7:25 AM on April 30, 2022: member

    LGTM

  15. MarcoFalke merged this on Apr 30, 2022
  16. MarcoFalke closed this on Apr 30, 2022

  17. sidhujag referenced this in commit eacf5a4216 on Apr 30, 2022
  18. bitcoin deleted a comment on May 2, 2022
  19. mzumsande deleted the branch on May 19, 2022
  20. bitcoin locked this on May 19, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:53 UTC