Disconnect may also result in an OSError, not only an AssertionError. Instead of maintaining a dead code path and enumerating disconnect reasons, just assume disconnection happens every time.
test: Fix intermittent race in p2p_unrequested_blocks.py #25124
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2205-test-race-📦 changing 1 files +5 −10-
MarcoFalke commented at 7:13 AM on May 13, 2022: member
-
MarcoFalke commented at 7:14 AM on May 13, 2022: member
For example https://cirrus-ci.com/task/5642614044098560?logs=ci#L3315
node0 2022-05-13T06:33:06.355942Z [msghand] [net_processing.cpp:4178] [MaybeDiscourageAndDisconnect] Warning: disconnecting but not discouraging local peer 1! node0 2022-05-13T06:33:06.355985Z [net] [net.cpp:567] [CloseSocketDisconnect] disconnecting peer=1 test 2022-05-13T06:33:06.356000Z TestFramework.p2p (DEBUG): Closed connection to: 127.0.0.1:11408 test 2022-05-13T06:33:06.356000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:11408: msg_ping(nonce=00000007) test 2022-05-13T06:33:06.356000Z TestFramework (ERROR): Unexpected exception caught during testing Traceback (most recent call last): File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 133, in main self.run_test() File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/p2p_unrequested_blocks.py", line 264, in run_test test_node.sync_with_ping(timeout=1) File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/p2p.py", line 555, in sync_with_ping self.send_message(msg_ping(nonce=self.ping_counter)) File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/p2p.py", line 266, in send_message return self.send_raw_message(tmsg) File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/p2p.py", line 270, in send_raw_message raise IOError('Not connected') OSError: Not connected -
test: Fix intermittent race in p2p_unrequested_blocks.py faac67cab0
- MarcoFalke force-pushed on May 13, 2022
- DrahtBot added the label Tests on May 13, 2022
-
jamesob commented at 1:33 PM on May 18, 2022: member
- MarcoFalke merged this on May 18, 2022
- MarcoFalke closed this on May 18, 2022
- MarcoFalke deleted the branch on May 18, 2022
- sidhujag referenced this in commit 3997686766 on May 28, 2022
- DrahtBot locked this on May 18, 2023
Contributors
Labels