From bbd75f31a6a23aaa45154d743ac42b49ef87d506 Mon Sep 17 00:00:00 2001 From: Simon Vrouwe Date: Sat, 6 Nov 2021 10:02:34 +0200 Subject: [PATCH] testing: fix test_closing_higherfee shutdown_subdaemons frees the channel and calls destroy_close_command_on_channel_destroy, see gdb: 0 destroy_close_command_on_channel_destroy (_=0x55db6ca38e18, cc=0x55db6ca43338) at lightningd/closing_control.c:94 1 0x000055db6a8181b5 in notify (ctx=0x55db6ca38df0, type=TAL_NOTIFY_FREE, info=0x55db6ca38e18, saved_errno=0) at ccan/ccan/tal/tal.c:237 2 0x000055db6a8186bb in del_tree (t=0x55db6ca38df0, orig=0x55db6ca38e18, saved_errno=0) at ccan/ccan/tal/tal.c:402 3 0x000055db6a818a47 in tal_free (ctx=0x55db6ca38e18) at ccan/ccan/tal/tal.c:486 4 0x000055db6a73fffa in shutdown_subdaemons (ld=0x55db6c8b4ca8) at lightningd/lightningd.c:543 5 0x000055db6a741098 in main (argc=21, argv=0x7ffffa3e8048) at lightningd/lightningd.c:1192 Before this PR, there was no io_loop after shutdown_subdaemons and client side raised a general `Connection to RPC server lost.` Now we test the more specific `Channel forgotten before proper close.`, which is good! BTW, this test was added recently in PR #4599. --- tests/test_closing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index ea85d82ec878..ea0f448d45f1 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -3099,7 +3099,7 @@ def test_closing_higherfee(node_factory, bitcoind, executor): l1.daemon.wait_for_log(r'deriving max fee from rate 30000 -> 16440sat \(not 1000000sat\)') # This will fail because l1 restarted! - with pytest.raises(RpcError, match=r'Connection to RPC server lost.'): + with pytest.raises(RpcError, match=r'Channel forgotten before proper close.'): fut.result(TIMEOUT) # But we still complete negotiation!