p2p_sendtxrcncl.py
currently fails intermittently in the CI, see e.g. https://cirrus-ci.com/task/5511952184115200?logs=ci#L4024
I believe that this is related to the reuse of the parameter p2p_idx=2
of add_outbound_p2p_connection
in this test: When we call peer_disconnect
, we don’t wait until the node has completed the disconnection. So there is a race between setting up the next connection (next addconnection
RPC), and if the old one hasn’t been removed and has an identical port like the new one (because we didn’t increment p2p_idx
), CConnman::OpenNetworkConnection
just returns without establishing a connection, and the test fails.
Fix this by using distinct disconnect_p2ps
instead of peer_disconnect
, which waits for the disconnect to complete. We can then use the same value for p2p_idx
everywhere.