Add checking delay within gap_bootstrap to fix intermittently failing 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.
This commit is contained in:
clemahieu 2023-09-01 12:43:35 +01:00 committed by Colin LeMahieu
commit 4c6b0766a6
No known key found for this signature in database
GPG key ID: 43708520C8DFB938

View file

@ -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);
}