Fix system.generate_send_new intermittent failures (#2742)

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.
This commit is contained in:
Guilherme Lawless 2020-04-28 11:05:42 +01:00 committed by GitHub
commit 7966efd652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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