Removing block_processor::flush from slow tests and command line operations.

This commit is contained in:
Colin LeMahieu 2024-01-26 17:38:13 +00:00
commit 701dbfd73f
No known key found for this signature in database
GPG key ID: 43708520C8DFB938
2 changed files with 8 additions and 7 deletions

View file

@ -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<std::chrono::microseconds> (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<std::chrono::microseconds> (end - begin).count ());
auto us_in_second (1000000);

View file

@ -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<nano::mutex> guard{ node.active.mutex };