Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timing issue in active_elections.fork_replacement_tally #4802

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nano/core_test/active_elections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ TEST (active_elections, fork_replacement_tally)
.build ();

// Forks without votes
std::shared_ptr<nano::election> election;
for (auto i (0); i < reps_count; i++)
{
auto fork = builder.make_block ()
Expand All @@ -913,10 +914,12 @@ TEST (active_elections, fork_replacement_tally)
.work (*system.work.generate (latest))
.build ();
node1.process_active (fork);

// Assert election exists and is the same for each fork
ASSERT_TIMELY (1s, election = node1.active.election (fork->qualified_root ()));
}

// Check overflow of blocks
std::shared_ptr<nano::election> election;
ASSERT_TIMELY (5s, election = node1.active.election (send_last->qualified_root ()));
ASSERT_TIMELY_EQ (5s, max_blocks, election->blocks ().size ());

Expand Down
Loading