From 56b018ca7f37d25041b74f1bec305bdf54a55b9b Mon Sep 17 00:00:00 2001 From: Fabian Jahr Date: Sat, 5 Sep 2020 19:55:37 +0200 Subject: [PATCH] test: Fix flaky wallet_basic test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: João Barbosa --- test/functional/wallet_basic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index 147c43f2f7c..bb208341a01 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -596,6 +596,9 @@ class WalletTest(BitcoinTestFramework): # wait until the wallet has submitted all transactions to the mempool self.wait_until(lambda: len(self.nodes[0].getrawmempool()) == chainlimit * 2) + # Prevent potential race condition when calling wallet RPCs right after restart + self.nodes[0].syncwithvalidationinterfacequeue() + node0_balance = self.nodes[0].getbalance() # With walletrejectlongchains we will not create the tx and store it in our wallet. assert_raises_rpc_error(-6, "Transaction has too long of a mempool chain", self.nodes[0].sendtoaddress, sending_addr, node0_balance - Decimal('0.01'))