aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-09-06 13:03:39 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-09-06 13:03:43 +0200
commitc91f955f44903df559ee8dfce1aa86cb89457b6e (patch)
tree087f7cc828e1060fc6367a00569337803cfb8e7a
parent03689317021a72431762c1974530f2a980a7fffa (diff)
parent56b018ca7f37d25041b74f1bec305bdf54a55b9b (diff)
Merge #19887: test: Fix flaky wallet_basic test
56b018ca7f37d25041b74f1bec305bdf54a55b9b test: Fix flaky wallet_basic test (Fabian Jahr) Pull request description: Fixes #19853 I investigated the issue in #19876 and I still intend to fix the underlying issue of a race when using wallet RPCs right after starting a node in that PR. However, since that is a bit more complicated than I initially thought it makes sense to merge the fix of the test so the intermittent test failures stop. This fix in the test is going to be needed, either way, #19876 will only provide an error where before it was reporting a false balance. Top commit has no ACKs. Tree-SHA512: 52bb2388a3e77aa20d26ab0fd45796bc1781483b1cffe49cbb44e2488a72e76998edfb1198495373f9c6fd2ec26064d4176bd1a64dd59806622d5e50a4f4e870
-rwxr-xr-xtest/functional/wallet_basic.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py
index 147c43f2f7..bb208341a0 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'))