From 4811dcc426ef3e20a3ddac7bc392d64be583a704 Mon Sep 17 00:00:00 2001 From: Larry Ruane Date: Wed, 8 Jul 2020 20:48:50 -0600 Subject: [PATCH] sync before stopping nodes This makes the test more deterministic. When the nodes are split, and partition B (node 1) mines a joinsplit transaction, that block only sometimes appears on the blockchain after the nodes are all reconnected. --- qa/rpc-tests/wallet_anchorfork.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qa/rpc-tests/wallet_anchorfork.py b/qa/rpc-tests/wallet_anchorfork.py index f02ab542a..86c56e72d 100755 --- a/qa/rpc-tests/wallet_anchorfork.py +++ b/qa/rpc-tests/wallet_anchorfork.py @@ -6,7 +6,9 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initialize_chain_clean, \ start_nodes, stop_nodes, connect_nodes_bi, \ - wait_and_assert_operationid_status, wait_bitcoinds, get_coinbase_address + wait_and_assert_operationid_status, wait_bitcoinds, get_coinbase_address, \ + sync_blocks, sync_mempools + from decimal import Decimal class WalletAnchorForkTest (BitcoinTestFramework): @@ -83,6 +85,8 @@ class WalletAnchorForkTest (BitcoinTestFramework): txid2 = self.nodes[1].sendrawtransaction(rawhex) assert_equal(txid, txid2) self.nodes[1].generate(1) + sync_blocks(self.nodes[1:]) + sync_mempools(self.nodes[1:]) # Check that Partition B is one block ahead and that they have different tips assert_equal(self.nodes[0].getblockcount() + 1, self.nodes[1].getblockcount())