mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-12 06:53:11 +02:00
fae807ed25test: Remove unused, confusing and brittle connect_nodes.wait_for_connect (MarcoFalke)fab2772647test: Fix all races after a socket is closed gracefully (MarcoFalke)fa21edddb2test: Stricter checks in rpc_setban.py (MarcoFalke)faa404e119test: Add is_connected_to helper (MarcoFalke) Pull request description: Currently, functional tests may intermittently fail, due to a lack of synchronization after a node connection socket was closed gracefully: If node A is connected to node B, and node B closes the connection, node A *must* wait for the connection to be closed before continuing the test. Otherwise, subsequent re-connections may not work while a stale connection is still alive. This can be reproduced locally via something like: ```diff diff --git a/src/net.cpp b/src/net.cpp index 6b79e913e8..32bd061500 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2200,2 +2200,3 @@ void CConnman::SocketHandlerConnected(const std::vector<CNode*>& nodes, } + UninterruptibleSleep(599ms); pnode->CloseSocketDisconnect(); ``` With this diff, the tests should fail on master, and pass after this fix. The fix is placed inside the `connect_nodes` helper. ACKs for top commit: rkrux: ACKfae807ed25w0xlt: ACKfae807ed25davidgumberg: (re-ish) crACKfae807ed25sedited: ACKfae807ed25Tree-SHA512: 053825bbd319d7c49e08810bbabbf9c3a43d89897d697c0ca9232fd8a88ae475b4f9fbd79dff549b4e0a8941cf926ca4567e7fd43dc1749bf023d8ee7dd49608
47 KiB
Executable File
47 KiB
Executable File