From 5a066d853673da875102cf6b230aedb729d32d6f Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sat, 6 Feb 2021 12:18:36 +0100 Subject: [PATCH] pytest: Stabilize test_forward_event_notification LightningNode.join_nodes and LightningNode.openchannel internally generate blocks, which causes nodes to be out of sync, and ignore "future" announcements, because they haven't seen that block yet. --- tests/test_plugin.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index e0e9d86d8..bb0f635bd 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -1175,19 +1175,24 @@ def test_forward_event_notification(node_factory, bitcoind, executor): """ amount = 10**8 disconnects = ['-WIRE_UPDATE_FAIL_HTLC', 'permfail'] - + plugin = os.path.join( + os.path.dirname(__file__), + 'plugins', + 'forward_payment_status.py' + ) l1, l2, l3, l4, l5 = node_factory.get_nodes(5, opts=[ {}, - {'plugin': os.path.join(os.getcwd(), 'tests/plugins/forward_payment_status.py')}, + {'plugin': plugin}, {}, {}, {'disconnect': disconnects}]) - node_factory.join_nodes([l1, l2, l3], wait_for_announce=True) - l2.openchannel(l4, wait_for_announce=False) - l2.openchannel(l5, wait_for_announce=True) + l1.openchannel(l2, confirm=False) + l2.openchannel(l3, confirm=False) + l2.openchannel(l4, confirm=False) + l2.openchannel(l5, confirm=False) sync_blockheight(bitcoind, [l1, l2, l3, l4, l5]) - bitcoind.generate_block(5) + bitcoind.generate_block(6) wait_for(lambda: len(l1.rpc.listchannels()['channels']) == 8)