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.
This commit is contained in:
Dimitrios Siganos 2021-04-27 23:23:05 +01:00 committed by dsiganos
commit 7672d4ed64

View file

@ -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 ());