Browse Source

pytest: fix flakiness in test_channel_reenable.

In one case, the channel_update which we expected to activate the channel
from l2 was suppressed as redundant.  This is certainly valid, so just
check the results.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
b379bec4e4
  1. 11
      tests/test_connection.py

11
tests/test_connection.py

@ -795,14 +795,13 @@ def test_channel_reenable(node_factory):
wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True, True]) wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True, True])
# Restart l2, will cause l1 to reconnect # Restart l2, will cause l1 to reconnect
l2.restart() l2.stop()
wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [False, False])
l2.start()
# Now they should sync and re-establish again # Updates may be suppressed if redundant; just test results.
l1.daemon.wait_for_logs(['Received channel_update for channel \\d+:1:1.1.',
'Received channel_update for channel \\d+:1:1.0.'])
l2.daemon.wait_for_logs(['Received channel_update for channel \\d+:1:1.1.',
'Received channel_update for channel \\d+:1:1.0.'])
wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True, True]) wait_for(lambda: [c['active'] for c in l1.rpc.listchannels()['channels']] == [True, True])
wait_for(lambda: [c['active'] for c in l2.rpc.listchannels()['channels']] == [True, True])
@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1") @unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")

Loading…
Cancel
Save