Skip to content

Commit

Permalink
pytest: fix test_you_forgot_closed_channel() closing assumption.
Browse files Browse the repository at this point in the history
Since we now time out connections more gently, we can race: make sure
we want for them to disconnect.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jul 14, 2022
1 parent b4de3fd commit ed9dc32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3446,9 +3446,10 @@ def test_you_forgot_closed_channel(node_factory, executor):
wait_for(lambda: only_one(only_one(l2.rpc.listpeers()['peers'])['channels'])['state'] == 'CLOSINGD_COMPLETE')
assert only_one(only_one(l1.rpc.listpeers()['peers'])['channels'])['state'] == 'CLOSINGD_SIGEXCHANGE'

# l2 closes on us.
wait_for(lambda: only_one(l1.rpc.listpeers()['peers'])['connected'] is False)

# l1 reconnects, it should succeed.
if only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected']:
l1.rpc.disconnect(l2.info['id'], force=True)
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
fut.result(TIMEOUT)

Expand Down

0 comments on commit ed9dc32

Please sign in to comment.