Skip to content

Commit

Permalink
pytest: fix flake in testing.
Browse files Browse the repository at this point in the history
As noted in 0a40623#diff-5871d4c569454db5e625383975462132da0bd03d32df145d8d72d8fafd86d952R3544-R3546

Turns out we sometimes hang up before l2 sees the previous tx revoked,
so we get a normal unilateral close, not a cheat.

Reported-by: Simon Vrouwe
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Nov 30, 2021
1 parent e2698c5 commit 5a5cf8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3540,10 +3540,10 @@ def test_upgrade_statickey_onchaind(node_factory, executor, bitcoind):
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.daemon.wait_for_log('option_static_remotekey enabled at 1/1')

# Make sure l2 gets REVOKE_AND_ACK from previous.
l2.daemon.wait_for_log('peer_out WIRE_REVOKE_AND_ACK')

# Pre-statickey penalty works.
# FIXME: Without this sleep, l1 will broadcasts one tx more compared to good
# case, causing `wait_for_onchaind_broadcast` to timeout.
time.sleep(5)
bitcoind.rpc.sendrawtransaction(tx)
bitcoind.generate_block(1)

Expand Down

0 comments on commit 5a5cf8c

Please sign in to comment.