diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -219,6 +219,11 @@ avalancheOutboundsCount == expectedAvalancheOutboundsCount; }); + interruptNet(); + if (threadOpenConnections.joinable()) { + threadOpenConnections.join(); + } + // Check each node belongs to a different group std::set> groups; ForEachNode([&](const CNode *pnode) { @@ -227,11 +232,6 @@ BOOST_CHECK_EQUAL(groups.size(), expectedOutboundFullRelayCount + expectedAvalancheOutboundsCount); - interruptNet(); - if (threadOpenConnections.joinable()) { - threadOpenConnections.join(); - } - return ret; } };