From e3a14f39697f9efc7fd5658ae903b50b80a401c2 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 26 May 2020 13:16:34 +0200 Subject: [PATCH] pytest: Fix up the payload replacement test There is a race between `getroute` learning that our peer accepts TLVs and us initiating the payment. Waiting for announcements ensures we always use TLVs, matching our expectation in the test / plugin. --- tests/test_plugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 5e348eaff..c9b026b24 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -1255,7 +1255,11 @@ def test_feature_set(node_factory): def test_replacement_payload(node_factory): """Test that htlc_accepted plugin hook can replace payload""" plugin = os.path.join(os.path.dirname(__file__), 'plugins/replace_payload.py') - l1, l2 = node_factory.line_graph(2, opts=[{}, {"plugin": plugin}]) + l1, l2 = node_factory.line_graph( + 2, + opts=[{}, {"plugin": plugin}], + wait_for_announce=True + ) # Replace with an invalid payload. l2.rpc.call('setpayload', ['0000'])