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
  1. MarcoFalke commented at 7:13 AM on May 13, 2022: member

    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.

  2. 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
    
  3. test: Fix intermittent race in p2p_unrequested_blocks.py faac67cab0
  4. MarcoFalke force-pushed on May 13, 2022
  5. DrahtBot added the label Tests on May 13, 2022
  6. MarcoFalke merged this on May 18, 2022
  7. MarcoFalke closed this on May 18, 2022

  8. MarcoFalke deleted the branch on May 18, 2022
  9. sidhujag referenced this in commit 3997686766 on May 28, 2022
  10. DrahtBot locked this on May 18, 2023
Contributors
Labels

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:13 UTC

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