From 07a92fedf32030dfa085142663d701a51e11cf97 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Fri, 26 Jan 2024 17:38:13 +0000 Subject: [PATCH] Removing block_processor::flush from slow tests and command line operations. --- nano/nano_node/entry.cpp | 10 ++++------ nano/slow_test/node.cpp | 5 ++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/nano/nano_node/entry.cpp b/nano/nano_node/entry.cpp index e77751762e..89cff93745 100644 --- a/nano/nano_node/entry.cpp +++ b/nano/nano_node/entry.cpp @@ -990,7 +990,6 @@ int main (int argc, char * const * argv) } } - node->block_processor.flush (); auto end (std::chrono::high_resolution_clock::now ()); auto time (std::chrono::duration_cast (end - begin).count ()); node->stop (); @@ -1083,7 +1082,10 @@ int main (int argc, char * const * argv) node->process_active (block); blocks.pop_front (); } - node->block_processor.flush (); + while (node->block_processor.size () > 0) + { + std::this_thread::sleep_for (std::chrono::milliseconds (100)); + } // Processing votes std::cerr << boost::str (boost::format ("Starting processing %1% votes\n") % max_votes); auto begin (std::chrono::high_resolution_clock::now ()); @@ -1191,7 +1193,6 @@ int main (int argc, char * const * argv) { node1->block_processor.add (block); } - node1->block_processor.flush (); auto iteration (0); while (node1->ledger.cache.block_count != count * 2 + 1) { @@ -1241,7 +1242,6 @@ int main (int argc, char * const * argv) node2->block_processor.add (block); blocks.pop_front (); } - node2->block_processor.flush (); while (node2->ledger.cache.block_count != count * 2 + 1) { std::this_thread::sleep_for (std::chrono::milliseconds (500)); @@ -1836,8 +1836,6 @@ int main (int argc, char * const * argv) } } - node.node->block_processor.flush (); - auto end (std::chrono::high_resolution_clock::now ()); auto time (std::chrono::duration_cast (end - begin).count ()); auto us_in_second (1000000); diff --git a/nano/slow_test/node.cpp b/nano/slow_test/node.cpp index 4310968dae..c36a60b4f9 100644 --- a/nano/slow_test/node.cpp +++ b/nano/slow_test/node.cpp @@ -1887,7 +1887,10 @@ TEST (node, mass_block_new) } ASSERT_TIMELY_EQ (200s, node.ledger.cache.block_count, next_block_count); next_block_count += num_blocks; - node.block_processor.flush (); + while (node.block_processor.size () > 0) + { + std::this_thread::sleep_for (std::chrono::milliseconds{ 100 }); + } // Clear all active { nano::lock_guard guard{ node.active.mutex };