From fefb7faba7c4254976539f3ba2865a46bf584c5c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 10 Aug 2018 15:48:33 +0930 Subject: [PATCH] pytest: try a simple reconnection test. This passes, but that's OK. Signed-off-by: Rusty Russell --- tests/test_connection.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_connection.py b/tests/test_connection.py index 1d763adc5..95c029c7d 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -292,6 +292,22 @@ def test_reconnect_openingd(node_factory): l2.daemon.wait_for_log('lightning_openingd.*UPDATE WIRE_OPENING_FUNDEE') +@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1") +def test_reconnect_gossiping(node_factory): + # connectd thinks we're still gossiping; peer reconnects. + disconnects = ['0WIRE_PING'] + l1 = node_factory.get_node(may_reconnect=True) + l2 = node_factory.get_node(disconnect=disconnects, + may_reconnect=True) + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + + l2.rpc.dev_ping(l1.info['id'], 1, 65532) + l1.daemon.wait_for_log('Forgetting peer') + + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + l2.daemon.wait_for_log('processing now old peer gone') + + @unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1") def test_reconnect_normal(node_factory): # Should reconnect fine even if locked message gets lost.