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:
stratospher
2025-12-12 20:13:24 +05:30
parent 597b8be223
commit 09dfa4d3f8

View File

@@ -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