From 7966efd6527892f4afbb85610558cb61c4b66234 Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Tue, 28 Apr 2020 11:05:42 +0100 Subject: [PATCH] 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. --- nano/core_test/ledger.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nano/core_test/ledger.cpp b/nano/core_test/ledger.cpp index e57aa97a7..4d82ae7e4 100644 --- a/nano/core_test/ledger.cpp +++ b/nano/core_test/ledger.cpp @@ -597,6 +597,8 @@ TEST (system, generate_send_new) ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::genesis_account)); std::vector 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); {