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

     0 node0 2022-05-13T06:33:06.355942Z [msghand] [net_processing.cpp:4178] [MaybeDiscourageAndDisconnect] Warning: disconnecting but not discouraging local peer 1! 
     1 node0 2022-05-13T06:33:06.355985Z [net] [net.cpp:567] [CloseSocketDisconnect] disconnecting peer=1 
     2 test  2022-05-13T06:33:06.356000Z TestFramework.p2p (DEBUG): Closed connection to: 127.0.0.1:11408 
     3 test  2022-05-13T06:33:06.356000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:11408: msg_ping(nonce=00000007) 
     4 test  2022-05-13T06:33:06.356000Z TestFramework (ERROR): Unexpected exception caught during testing 
     5                                   Traceback (most recent call last):
     6                                     File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 133, in main
     7                                       self.run_test()
     8                                     File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/p2p_unrequested_blocks.py", line 264, in run_test
     9                                       test_node.sync_with_ping(timeout=1)
    10                                     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
    11                                       self.send_message(msg_ping(nonce=self.ping_counter))
    12                                     File "/tmp/cirrus-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/p2p.py", line 266, in send_message
    13                                       return self.send_raw_message(tmsg)
    14                                     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
    15                                       raise IOError('Not connected')
    16                                   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

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: 2024-07-01 10:13 UTC

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