Skip to content

Commit

Permalink
pytest: fix flake in test_rbf_non_last_mined
Browse files Browse the repository at this point in the history
A race condition seemed to be redirecting rpc before bitcoind processed
the second rbf transaction.
  • Loading branch information
endothermicdev committed May 9, 2024
1 parent 8b2a685 commit bb95de4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_opening.py
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ def test_rbf_non_last_mined(node_factory, bitcoind, chainparams):
res = l1.rpc.fundchannel(l2.info['id'], chan_amount, feerate='7500perkw')
chan_id = res['channel_id']
vins = bitcoind.rpc.decoderawtransaction(res['tx'])['vin']
assert(only_one(vins))
assert only_one(vins)
prev_utxos = ["{}:{}".format(vins[0]['txid'], vins[0]['vout'])]

# Check that we're waiting for lockin
Expand Down Expand Up @@ -1358,8 +1358,13 @@ def censoring_sendrawtx(r):

# Make a 3rd inflight that won't make it into the mempool
signed_psbt = run_retry()
last = len(l1.daemon.logs)
l1.rpc.openchannel_signed(chan_id, signed_psbt)

wait_for(lambda: l1.daemon.is_in_log("plugin-bcli: sendrawtx exit 0", start=last))
import time
time.sleep(.05)

l1.daemon.rpcproxy.mock_rpc('sendrawtransaction', None)
l2.daemon.rpcproxy.mock_rpc('sendrawtransaction', None)

Expand Down

0 comments on commit bb95de4

Please sign in to comment.