Skip to content

test: Fix intermittent issue in p2p_segwit.py - #21792

Merged
maflcko merged 2 commits into
bitcoin:masterfrom
maflcko:2104-testInt2
Apr 29, 2021
Merged

maflcko merged 2 commits into
bitcoin:masterfrom
maflcko:2104-testInt2

Conversation

@maflcko

@maflcko maflcko commented Apr 28, 2021

Copy link
Copy Markdown
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

@fanquake fanquake added the Tests label Apr 28, 2021
@maflcko

maflcko commented Apr 28, 2021

Copy link
Copy Markdown
Member Author

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.

@DrahtBot

Copy link
Copy Markdown
Contributor

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

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.

@Sjors

Sjors commented Apr 29, 2021

Copy link
Copy Markdown
Member

Maybe rebase in light of #21804 merge.

@maflcko

maflcko commented Apr 29, 2021

Copy link
Copy Markdown
Member Author

Rebased, as requested by @Sjors

@jnewbery

Copy link
Copy Markdown
Contributor

ACK fad6269

@dhruv

dhruv commented Apr 29, 2021

Copy link
Copy Markdown
Contributor

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.

@maflcko
maflcko merged commit 40310f5 into bitcoin:master Apr 29, 2021
@maflcko
maflcko deleted the 2104-testInt2 branch April 30, 2021 06:06
@adamjonas

Copy link
Copy Markdown
Contributor

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.

gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
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.

7 participants