From 8aab5157c55249c9023ae4e9654f5d42aaa4f314 Mon Sep 17 00:00:00 2001 From: furszy Date: Thu, 23 Mar 2023 16:37:06 -0300 Subject: [PATCH] test: wallet_create_tx.py fix race Because wallets are internally synchronized through the validation interface, and the interface dispatches events on a worker thread, it is possible for a transaction created by the first wallet to not arrive at the second wallet before the second wallet attempts to use one of its outputs. This is because we do not wait for the BroadcastTransaction callback during the wallet's "submit to mempool" process. To address this in the tests, we need to sync the validation queue. --- test/functional/wallet_create_tx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/wallet_create_tx.py b/test/functional/wallet_create_tx.py index 11c82e15b7e..4e31b48ec01 100755 --- a/test/functional/wallet_create_tx.py +++ b/test/functional/wallet_create_tx.py @@ -92,6 +92,7 @@ class CreateTxWalletTest(BitcoinTestFramework): txid = tx_data['txid'] vout = 1 + self.nodes[0].syncwithvalidationinterfacequeue() options = {"change_position": 0, "add_inputs": False} for i in range(1, 25): options['inputs'] = [{'txid': txid, 'vout': vout}]