Skip to content

Commit

Permalink
Add checking delay within gap_bootstrap to fix intermittently failing…
Browse files Browse the repository at this point in the history
… test. (#4273)

The block is not guaranteed to be broadcast to both other nodes after it is generated with ::send_action so use ASSERT_TIMELY to check for the correct conditions.
  • Loading branch information
clemahieu committed Sep 1, 2023
1 parent 21b77a8 commit 4c6b076
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nano/core_test/gap_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ TEST (gap_cache, gap_bootstrap)
system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv);
auto latest_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, 100));
ASSERT_NE (nullptr, latest_block);
ASSERT_EQ (nano::dev::constants.genesis_amount - 200, node1.balance (nano::dev::genesis->account ()));
ASSERT_EQ (nano::dev::constants.genesis_amount, node2.balance (nano::dev::genesis->account ()));
ASSERT_TIMELY (5s, nano::dev::constants.genesis_amount - 200 == node1.balance (nano::dev::genesis->account ()));
ASSERT_TIMELY (5s, nano::dev::constants.genesis_amount == node2.balance (nano::dev::genesis->account ()));
ASSERT_TIMELY (5s, node2.balance (nano::dev::genesis->account ()) == nano::dev::constants.genesis_amount - 200);
}

Expand Down

0 comments on commit 4c6b076

Please sign in to comment.