From 09dfa4d3f8dfbea61a73d4add79e2464ca776571 Mon Sep 17 00:00:00 2001 From: stratospher <44024636+stratospher@users.noreply.github.com> Date: Fri, 12 Dec 2025 20:13:24 +0530 Subject: [PATCH] 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. --- test/functional/p2p_v2_misbehaving.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/p2p_v2_misbehaving.py b/test/functional/p2p_v2_misbehaving.py index ee589010cdd..32fe2833bc0 100755 --- a/test/functional/p2p_v2_misbehaving.py +++ b/test/functional/p2p_v2_misbehaving.py @@ -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