From 7672d4ed6499e10b62a82d7310159376ac8db04d Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Tue, 27 Apr 2021 23:23:05 +0100 Subject: [PATCH] Fix core test case election.quorum_minimum_confirm_success (#3242) The test asks the scheduler to activate an election and then check to see the election is in the active election container. However, node.scheduler.activate() is not a blocking operation and the election activation happens in the background at an unspecified time. To solve this, the election scheduler can be flushed before checking the active election container. --- nano/core_test/election.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/nano/core_test/election.cpp b/nano/core_test/election.cpp index 8ac70cf4..825e2bc5 100644 --- a/nano/core_test/election.cpp +++ b/nano/core_test/election.cpp @@ -132,6 +132,7 @@ TEST (election, quorum_minimum_confirm_success) node1.process_active (send1); node1.block_processor.flush (); node1.scheduler.activate (nano::dev_genesis_key.pub, node1.store.tx_begin_read ()); + node1.scheduler.flush (); auto election = node1.active.election (send1->qualified_root ()); ASSERT_NE (nullptr, election); ASSERT_EQ (1, election->blocks ().size ());