From 8ada651e917dac15158b651dc2bf6ba869e76fa2 Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Wed, 29 Apr 2020 11:08:58 +0100 Subject: [PATCH] Apply similar fix to node_telemetry.remove_peer_different_genesis_udp as the tcp version in https://github.com/nanocurrency/nano-node/pull/2738 --- nano/core_test/node_telemetry.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nano/core_test/node_telemetry.cpp b/nano/core_test/node_telemetry.cpp index 081a0384ca..de8efd3f98 100644 --- a/nano/core_test/node_telemetry.cpp +++ b/nano/core_test/node_telemetry.cpp @@ -774,12 +774,12 @@ TEST (node_telemetry, remove_peer_different_genesis_udp) ASSERT_TIMELY (10s, node0->stats.count (nano::stat::type::telemetry, nano::stat::detail::different_genesis_hash) != 0 && node1->stats.count (nano::stat::type::telemetry, nano::stat::detail::different_genesis_hash) != 0); - ASSERT_EQ (0, node0->network.size ()); - ASSERT_EQ (0, node1->network.size ()); - system.poll_until_true (3s, [&node0, address = node1->network.endpoint ().address ()]() -> bool { - nano::lock_guard guard (node0->network.excluded_peers.mutex); - return node0->network.excluded_peers.peers.get ().count (address); - }); + ASSERT_TIMELY (1s, 0 == node0->network.size ()); + ASSERT_TIMELY (1s, 0 == node1->network.size ()); + + nano::lock_guard guard (node0->network.excluded_peers.mutex); + ASSERT_EQ (1, node0->network.excluded_peers.peers.get ().count (node1->network.endpoint ().address ())); + ASSERT_EQ (1, node1->network.excluded_peers.peers.get ().count (node0->network.endpoint ().address ())); } TEST (node_telemetry, remove_peer_invalid_signature)