From 667e26ae4868853755fdf751a71086827fde6414 Mon Sep 17 00:00:00 2001 From: Sergey Kroshnin Date: Mon, 10 May 2021 18:44:03 +0300 Subject: [PATCH] Adjust active_transactions.pessimistic_elections & network.last_contacted (#3270) * active_transactions.pessimistic_elections - Follow test commentary * network.last_contacted - Prevent ephemeral node1->node0 channel repacement in container with incoming connection --- nano/core_test/active_transactions.cpp | 2 +- nano/core_test/network.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nano/core_test/active_transactions.cpp b/nano/core_test/active_transactions.cpp index 3ff0935b..e9359976 100644 --- a/nano/core_test/active_transactions.cpp +++ b/nano/core_test/active_transactions.cpp @@ -1396,7 +1396,7 @@ TEST (active_transactions, pessimistic_elections) } // Wait until activation of destination account is done. - ASSERT_TIMELY (10s, node.active.active (send2->qualified_root ())); + ASSERT_TIMELY (10s, node.active.active (open->qualified_root ())); // Election count should not increase, but the elections should be marked as started for that account afterwards ASSERT_EQ (election_started_it->election_started, false); diff --git a/nano/core_test/network.cpp b/nano/core_test/network.cpp index 7b4b9ec5..304c727e 100644 --- a/nano/core_test/network.cpp +++ b/nano/core_test/network.cpp @@ -135,7 +135,9 @@ TEST (network, last_contacted) nano::system system (1); auto node0 = system.nodes[0]; ASSERT_EQ (0, node0->network.size ()); - auto node1 (std::make_shared (system.io_ctx, nano::get_available_port (), nano::unique_path (), system.logging, system.work)); + nano::node_config node1_config (nano::get_available_port (), system.logging); + node1_config.tcp_incoming_connections_max = 0; // Prevent ephemeral node1->node0 channel repacement with incoming connection + auto node1 (std::make_shared (system.io_ctx, nano::unique_path (), node1_config, system.work)); node1->start (); system.nodes.push_back (node1); auto channel1 = nano::establish_tcp (system, *node1, node0->network.endpoint ());