From 81b0822772169cb697b5994f49398e619d61a12d Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Mon, 26 Feb 2018 14:04:41 -0800 Subject: test: Use wait_until in tests where time was used for polling --- test/functional/wallet_basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/wallet_basic.py') diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index f686cb6ea5..dcd6c54d97 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -379,9 +379,9 @@ class WalletTest(BitcoinTestFramework): self.start_node(0, [m, "-limitancestorcount="+str(chainlimit)]) self.start_node(1, [m, "-limitancestorcount="+str(chainlimit)]) self.start_node(2, [m, "-limitancestorcount="+str(chainlimit)]) - while m == '-reindex' and [block_count] * 3 != [self.nodes[i].getblockcount() for i in range(3)]: + if m == '-reindex': # reindex will leave rpc warm up "early"; Wait for it to finish - time.sleep(0.1) + wait_until(lambda: [block_count] * 3 == [self.nodes[i].getblockcount() for i in range(3)]) assert_equal(balance_nodes, [self.nodes[i].getbalance() for i in range(3)]) # Exercise listsinceblock with the last two blocks -- cgit v1.2.3