From ebc851b1d20d6cbeafd812ecb667f2d8b996e12d Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Wed, 28 Apr 2021 00:45:34 +0100 Subject: [PATCH] Fix tests quorum_minimum_confirm_fail, quorum_minimum_update_weight_before_quorum_checks Those tests has an election scheduler activate and immediate access to election active container without a flush or a wait in between. --- nano/core_test/election.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nano/core_test/election.cpp b/nano/core_test/election.cpp index 825e2bc5..0dabbdec 100644 --- a/nano/core_test/election.cpp +++ b/nano/core_test/election.cpp @@ -165,6 +165,7 @@ TEST (election, quorum_minimum_confirm_fail) 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 ()); @@ -235,6 +236,7 @@ TEST (election, quorum_minimum_update_weight_before_quorum_checks) ASSERT_EQ (node2.ledger.cache.block_count, 4); 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 ());