From 0dd0d530579f479e75bb6737a0391171b78cfb60 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 28 Mar 2016 21:47:13 +0200 Subject: [PATCH] [qa] wallet: Wait for reindex to catch up --- qa/rpc-tests/wallet.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 71c73a0b7..1cb010912 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -280,6 +280,7 @@ class WalletTest (BitcoinTestFramework): blocks = self.nodes[0].generate(2) self.sync_all() balance_nodes = [self.nodes[i].getbalance() for i in range(3)] + block_count = self.nodes[0].getblockcount() # Check modes: # - True: unicode escaped as \u.... @@ -306,6 +307,9 @@ class WalletTest (BitcoinTestFramework): stop_nodes(self.nodes) wait_bitcoinds() self.nodes = start_nodes(3, self.options.tmpdir, [[m]] * 3) + while m == '-reindex' and [block_count] * 3 != [self.nodes[i].getblockcount() for i in range(3)]: + # reindex will leave rpc warm up "early"; Wait for it to finish + time.sleep(0.1) assert_equal(balance_nodes, [self.nodes[i].getbalance() for i in range(3)]) # Exercise listsinceblock with the last two blocks