Skip to content

Commit

Permalink
Fix system.generate_send_new intermittent failures (#2742)
Browse files Browse the repository at this point in the history
This is likely due to wallet rep counts not updating quick enough on CI due to online weight fluctuating very heavily in this test, causing votes to not be generated. Waiting for the online weight to stabilize by waiting on a voting rep should fix it.

Ran CI twice and didn't trigger whereas it would trigger often without this change.
  • Loading branch information
guilhermelawless committed Apr 28, 2020
1 parent 91aafd2 commit 7966efd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nano/core_test/ledger.cpp
Expand Up @@ -597,6 +597,8 @@ TEST (system, generate_send_new)
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::genesis_account));
std::vector<nano::account> accounts;
accounts.push_back (nano::test_genesis_key.pub);
// This indirectly waits for online weight to stabilize, required to prevent intermittent failures
ASSERT_TIMELY (5s, node1.wallets.rep_counts ().voting > 0);
system.generate_send_new (node1, accounts);
nano::account new_account (0);
{
Expand Down

0 comments on commit 7966efd

Please sign in to comment.