tests: cleanup any unfinished/hanging channel opens

Otherwise it hangs on cleanup, as l2 is waiting for l1 to respond (and
it's not going to), so the memleak call hangs.
This commit is contained in:
niftynei 2021-06-01 11:12:03 -05:00 committed by Rusty Russell
parent b5aaee6679
commit e95fc74884

View file

@ -3463,12 +3463,20 @@ def test_openchannel_init_alternate(node_factory, executor):
psbt1 = l1.rpc.fundpsbt('1000000msat', '253perkw', 250)['psbt']
psbt2 = l2.rpc.fundpsbt('1000000msat', '253perkw', 250)['psbt']
l1.rpc.openchannel_init(l2.info['id'], 100000, psbt1)
init = l1.rpc.openchannel_init(l2.info['id'], 100000, psbt1)
fut = executor.submit(l2.rpc.openchannel_init, l1.info['id'], '1000000msat', psbt2)
with pytest.raises(RpcError):
fut.result(10)
# FIXME: Clean up so it doesn't hang. Ok if these fail.
for node in [l1, l2]:
try:
node.rpc.openchannel_abort(init['channel_id'])
except RpcError:
# Ignoring all errors
print("nothing to do")
@unittest.skipIf(not EXPERIMENTAL_FEATURES, "quiescence is experimental")
@pytest.mark.developer("quiescence triggering is dev only")