mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
test: fix race condition in p2p_v2_misbehaving.py peerid assertion
due to asyncio's non-deterministic task scheduling, peer2's connection might happen before peer1's, causing peer2 to get assigned peer_id=1 on bitcoind side and peer1 to get assigned peer_id=2 on bitcoind side. since we test that peer2 remains connected, any disconnection must originate from peer1, making the specific peer id unnecessary for test correctness. so we can remove the specific peer_id from the expected debug log.
This commit is contained in:
@@ -161,8 +161,8 @@ class EncryptedP2PMisbehaving(BitcoinTestFramework):
|
||||
node0 = self.nodes[0]
|
||||
expected_debug_message = [
|
||||
[], # EARLY_KEY_RESPONSE
|
||||
["V2 transport error: missing garbage terminator, peer=1"], # EXCESS_GARBAGE
|
||||
["V2 handshake timeout, disconnecting peer=3"], # WRONG_GARBAGE_TERMINATOR
|
||||
["V2 transport error: missing garbage terminator"], # EXCESS_GARBAGE
|
||||
["V2 handshake timeout, disconnecting peer"], # WRONG_GARBAGE_TERMINATOR
|
||||
["V2 transport error: packet decryption failure"], # WRONG_GARBAGE
|
||||
["V2 transport error: packet decryption failure"], # SEND_NO_AAD
|
||||
[], # SEND_NON_EMPTY_VERSION_PACKET
|
||||
|
||||
Reference in New Issue
Block a user