From cc7add94fe147498467ff6076464659673965fa7 Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Wed, 4 Mar 2020 17:08:27 +0000 Subject: [PATCH] Enhance node.activate_dependencies test by ensuring full confirmation (Serg review) --- nano/core_test/active_transactions.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nano/core_test/active_transactions.cpp b/nano/core_test/active_transactions.cpp index 80c679837a..4daf82e091 100644 --- a/nano/core_test/active_transactions.cpp +++ b/nano/core_test/active_transactions.cpp @@ -711,7 +711,6 @@ TEST (active_transactions, activate_dependencies) system.wallet (0)->insert_adhoc (nano::test_genesis_key.prv); nano::genesis genesis; nano::block_builder builder; - system.deadline_set (std::chrono::seconds (15)); std::shared_ptr block0 = builder.state () .account (nano::test_genesis_key.pub) .previous (genesis.hash ()) @@ -724,6 +723,7 @@ TEST (active_transactions, activate_dependencies) // Establish a representative node2->process_active (block0); node2->block_processor.flush (); + system.deadline_set (10s); while (node1->block (block0->hash ()) == nullptr) { ASSERT_NO_ERROR (system.poll ()); @@ -752,9 +752,17 @@ TEST (active_transactions, activate_dependencies) .build (); node2->process_active (block2); node2->block_processor.flush (); + system.deadline_set (10s); while (node1->block (block2->hash ()) == nullptr) { ASSERT_NO_ERROR (system.poll ()); } ASSERT_NE (nullptr, node1->block (block2->hash ())); + system.deadline_set (10s); + while (!node1->active.empty () || !node2->active.empty ()) + { + ASSERT_NO_ERROR (system.poll ()); + } + ASSERT_TRUE (node1->ledger.block_confirmed (node1->store.tx_begin_read (), block2->hash ())); + ASSERT_TRUE (node2->ledger.block_confirmed (node2->store.tx_begin_read (), block2->hash ())); }