Skip to content

Commit

Permalink
Fix race condition in test election_scheduler.no_vacancy
Browse files Browse the repository at this point in the history
Blocks send and receive are not confirmed for sure since nothing waits for
their confirmation. If they do not confirm in time, then one of the blocks
send or receive will take the only available place in the AEC and not
block2 as expected.
  • Loading branch information
dsiganos committed Apr 17, 2024
1 parent 6596cef commit 3f0510d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nano/core_test/election_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ TEST (election_scheduler, no_vacancy)
ASSERT_EQ (nano::block_status::progress, node.process (receive));
node.process_confirmed (nano::election_status{ receive });

ASSERT_TIMELY (5s, nano::test::confirmed (node, { send, receive }));

// Second, process two eligible transactions
auto block1 = builder.make_block ()
.account (nano::dev::genesis_key.pub)
Expand Down

0 comments on commit 3f0510d

Please sign in to comment.