test: Fix intermittent issue in p2p_segwit.py #21792

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2104-testInt2 changing 2 files +5 −3
  1. MarcoFalke commented at 7:30 AM on April 28, 2021: member

    Calling start_node might call wait_for_rpc_connection, which will fail.

    https://cirrus-ci.com/task/5669555591708672?logs=ci#L3504

      File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/p2p_segwit.py", line 1974, in test_upgrade_after_activation
        self.start_node(2, extra_args=["-reindex", f"-segwitheight={SEGWIT_HEIGHT}"])
      File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 508, in start_node
        node.wait_for_rpc_connection()
      File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_node.py", line 224, in wait_for_rpc_connection
        raise FailedToStartError(self._node_msg(
    test_framework.test_node.FailedToStartError: [node 2] bitcoind exited with status 1 during initialization
    
  2. fanquake added the label Tests on Apr 28, 2021
  3. MarcoFalke commented at 7:42 AM on April 28, 2021: member

    Actually I have no idea how this test could even pass in the first place. All code paths here should eventually raise FailedToStartError, which shouldn't be caught and thus fail the test.

    If someone wants to investigate this, that'd be great. Though the diff here should still be correct, as assert_start_raises_init_error is the proper way to check for init errors.

  4. MarcoFalke force-pushed on Apr 28, 2021
  5. DrahtBot commented at 4:08 PM on April 28, 2021: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #20799 (net processing: Only support version 2 compact blocks by jnewbery)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. Sjors commented at 10:53 AM on April 29, 2021: member

    Maybe rebase in light of #21804 merge.

  7. test: Fix intermittent issue in p2p_segwit.py faecb72c3c
  8. test: Assert that exit code indicates failure fad6269916
  9. MarcoFalke force-pushed on Apr 29, 2021
  10. MarcoFalke commented at 11:04 AM on April 29, 2021: member

    Rebased, as requested by @Sjors

  11. jnewbery commented at 4:01 PM on April 29, 2021: member

    ACK fad6269916dbf8adc14d757a18f19c74e95cf659

  12. dhruv commented at 6:03 PM on April 29, 2021: member

    ACK fad6269

    Thank for the fix, and showing me assert_start_raises_init_error @MarcoFalke. I am incorporating this into #21090 as well. It is indeed perplexing that the error was only intermittent.

  13. MarcoFalke merged this on Apr 29, 2021
  14. MarcoFalke closed this on Apr 29, 2021

  15. sidhujag referenced this in commit b03c8eb2ee on Apr 30, 2021
  16. MarcoFalke deleted the branch on Apr 30, 2021
  17. adamjonas commented at 3:14 PM on May 5, 2021: member

    Verifying the efficacy of this patch.

    • The 4 days before this PR was merged there were 235 builds of master on cirrusCI resulting in 4 p2p_segwit.py failures.
    • Since its merge, there have been 343 builds of master and 0 p2p_segwit.py failures.
  18. gwillen referenced this in commit 4485d3c785 on Jun 1, 2022
  19. DrahtBot locked this on Aug 16, 2022

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-04-17 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me