dev_disconnect: support multiple disconnects in the same daemon.

We currently assume the daemon gives up; gossipd won't, and we want to
test it there too.

This reveals a bug (returning io_close() is bad if the call is to
duplex()), and breaks a test which now continues after dropping a
packet..

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-10-11 20:39:49 +10:30
committed by Christian Decker
parent 6ceec17943
commit 2273ce783e
3 changed files with 21 additions and 9 deletions

View File

@@ -1354,9 +1354,12 @@ class LightningDTests(BaseLightningDTests):
assert l2.rpc.listinvoice('testpayment2')[0]['complete'] == True
def test_reconnect_receiver_fulfill(self):
disconnects = ['-WIRE_UPDATE_FULFILL_HTLC',
'@WIRE_UPDATE_FULFILL_HTLC',
# Ordering matters: after +WIRE_UPDATE_FULFILL_HTLC, channeld
# will continue and try to send WIRE_COMMITMENT_SIGNED: if
# that's the next failure, it will do two in one run.
disconnects = ['@WIRE_UPDATE_FULFILL_HTLC',
'+WIRE_UPDATE_FULFILL_HTLC',
'-WIRE_UPDATE_FULFILL_HTLC',
'-WIRE_COMMITMENT_SIGNED',
'@WIRE_COMMITMENT_SIGNED',
'+WIRE_COMMITMENT_SIGNED',