Skip to content

Commit

Permalink
Removing block_processor::flush from slow tests and command line oper…
Browse files Browse the repository at this point in the history
…ations.
  • Loading branch information
clemahieu committed Jan 31, 2024
1 parent 299bfbc commit 701dbfd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 4 additions & 6 deletions nano/nano_node/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
Expand Down Expand Up @@ -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 ());
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion nano/slow_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit 701dbfd

Please sign in to comment.