diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-04-29 20:44:21 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-04-29 20:44:24 +0200 |
commit | 40310f5e8cd783a8114dc07224b435497bae6817 (patch) | |
tree | fe94d89c178dbb35f66137a1f4f605bab17fea03 | |
parent | d9ae6ec8929e739187740baab206daa55cde61d1 (diff) | |
parent | fad6269916dbf8adc14d757a18f19c74e95cf659 (diff) |
Merge bitcoin/bitcoin#21792: test: Fix intermittent issue in p2p_segwit.py
fad6269916dbf8adc14d757a18f19c74e95cf659 test: Assert that exit code indicates failure (MarcoFalke)
faecb72c3ca744f1adb77bd910c643cedec3b445 test: Fix intermittent issue in p2p_segwit.py (MarcoFalke)
Pull request description:
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
ACKs for top commit:
jnewbery:
ACK fad6269916dbf8adc14d757a18f19c74e95cf659
dhruv:
ACK fad6269
Tree-SHA512: 4c5e39ce25e135717ea433258518f93f09d1c528c4538a8627d3da13bc0c0ba4b45911703c26392ff0f5e0cb7831a6c7cc53e6e29102d3da9c8cfce7cef333cc
-rwxr-xr-x | test/functional/p2p_segwit.py | 7 | ||||
-rwxr-xr-x | test/functional/test_framework/test_node.py | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py index 1b6e122ee4..9d32c1cb86 100755 --- a/test/functional/p2p_segwit.py +++ b/test/functional/p2p_segwit.py @@ -1966,9 +1966,10 @@ class SegWitTest(BitcoinTestFramework): # Restarting node 2 should result in a shutdown because the blockchain consists of # insufficiently validated blocks per segwit consensus rules. self.stop_node(2) - with self.nodes[2].assert_debug_log(expected_msgs=[ - f"Witness data for blocks after height {SEGWIT_HEIGHT} requires validation. Please restart with -reindex."], timeout=10): - self.nodes[2].start([f"-segwitheight={SEGWIT_HEIGHT}"]) + self.nodes[2].assert_start_raises_init_error( + extra_args=[f"-segwitheight={SEGWIT_HEIGHT}"], + expected_msg=f": Witness data for blocks after height {SEGWIT_HEIGHT} requires validation. Please restart with -reindex..\nPlease restart with -reindex or -reindex-chainstate to recover.", + ) # As directed, the user restarts the node with -reindex self.start_node(2, extra_args=["-reindex", f"-segwitheight={SEGWIT_HEIGHT}"]) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index ce9c1bc024..c17c16f797 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -491,6 +491,7 @@ class TestNode(): self.start(extra_args, stdout=log_stdout, stderr=log_stderr, *args, **kwargs) ret = self.process.wait(timeout=self.rpc_timeout) self.log.debug(self._node_msg(f'bitcoind exited with status {ret} during initialization')) + assert ret != 0 # Exit code must indicate failure self.running = False self.process = None # Check stderr for expected message |