From e95fc7488416b6273c2553f5d3ce2ace788cba71 Mon Sep 17 00:00:00 2001 From: niftynei Date: Tue, 1 Jun 2021 11:12:03 -0500 Subject: [PATCH] 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. --- tests/test_connection.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index b4368a090..e2ede44df 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -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")