From f3804daabb9f5ab485a2cd1eac5905db625621a3 Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Tue, 3 Nov 2020 09:54:00 +1030 Subject: [PATCH] pytest: simplify test_openchannel_hook_chaining now order is deterministic. --- tests/test_plugin.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 5c41737ce..39c507c60 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -613,18 +613,9 @@ def test_openchannel_hook_chaining(node_factory, bitcoind): with pytest.raises(RpcError, match=r'They sent error channel'): l1.rpc.fundchannel(l2.info['id'], 100005) - # Note: hook chain order is currently undefined, because hooks are registerd - # as a result of the getmanifest call, which may take some random time. - # We need to workaround that fact, so test can be stable - correct_order = l2.daemon.is_in_log(hook_msg + "reject for a reason") - if correct_order: - assert l2.daemon.wait_for_log(hook_msg + "reject for a reason") - # the other plugin must not be called - assert not l2.daemon.is_in_log("reject on principle") - else: - assert l2.daemon.wait_for_log(hook_msg + "reject on principle") - # the other plugin must not be called - assert not l2.daemon.is_in_log("reject for a reason") + assert l2.daemon.wait_for_log(hook_msg + "reject for a reason") + # the third plugin must now not be called anymore + assert not l2.daemon.is_in_log("reject on principle") # 100000sat is good for hook_accepter, so it should fail 'on principle' # at third hook openchannel_reject.py