mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-26 20:30:59 +01:00
pyln-testing: disable seeker autoconnect by default
This avoids test flakes, but can be explicitly set if needed. Changelog-None
This commit is contained in:
parent
c596550de1
commit
11580dfd43
2 changed files with 8 additions and 5 deletions
|
@ -816,6 +816,8 @@ class LightningNode(object):
|
||||||
self.daemon.opts["experimental-dual-fund"] = None
|
self.daemon.opts["experimental-dual-fund"] = None
|
||||||
if EXPERIMENTAL_SPLICING:
|
if EXPERIMENTAL_SPLICING:
|
||||||
self.daemon.opts["experimental-splicing"] = None
|
self.daemon.opts["experimental-splicing"] = None
|
||||||
|
# Avoid test flakes cause by this option unless explicitly set.
|
||||||
|
self.daemon.opts.update({"autoconnect-seeker-peers": 0})
|
||||||
|
|
||||||
if options is not None:
|
if options is not None:
|
||||||
self.daemon.opts.update(options)
|
self.daemon.opts.update(options)
|
||||||
|
|
|
@ -30,7 +30,8 @@ def test_gossip_pruning(node_factory, bitcoind):
|
||||||
""" Create channel and see it being updated in time before pruning
|
""" Create channel and see it being updated in time before pruning
|
||||||
"""
|
"""
|
||||||
l1, l2, l3 = node_factory.get_nodes(3, opts={'dev-fast-gossip-prune': None,
|
l1, l2, l3 = node_factory.get_nodes(3, opts={'dev-fast-gossip-prune': None,
|
||||||
'allow_bad_gossip': True})
|
'allow_bad_gossip': True,
|
||||||
|
'autoconnect-seeker-peers': 0})
|
||||||
|
|
||||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||||
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
|
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
|
||||||
|
@ -2336,13 +2337,14 @@ def test_gossip_seeker_autoconnect(node_factory):
|
||||||
necessary."""
|
necessary."""
|
||||||
|
|
||||||
port = node_factory.get_unused_port()
|
port = node_factory.get_unused_port()
|
||||||
opts = [{'autoconnect-seeker-peers': 0, 'may_reconnect': True},
|
opts = [{'may_reconnect': True,
|
||||||
|
'autoconnect-seeker-peers': 0},
|
||||||
{'may_reconnect': True},
|
{'may_reconnect': True},
|
||||||
{'bind-addr': f'127.0.0.1:{port}',
|
{'bind-addr': f'127.0.0.1:{port}',
|
||||||
'announce-addr': f'127.0.0.1:{port}'}]
|
'announce-addr': f'127.0.0.1:{port}'}]
|
||||||
l1, l2, l3 = node_factory.line_graph(3, opts=opts, wait_for_announce=True)
|
l1, l2, l3 = node_factory.line_graph(3, opts=opts, wait_for_announce=True)
|
||||||
l2.daemon.wait_for_log('gossipd: seeker: need more peers for gossip')
|
l1.daemon.wait_for_log('seeker: chosen for periodic full sync')
|
||||||
time.sleep(1)
|
time.sleep(10)
|
||||||
# The seeker wants more peers, but l1 should not autoconnect due to option.
|
# The seeker wants more peers, but l1 should not autoconnect due to option.
|
||||||
assert not l1.daemon.is_in_log(r'lightningd: attempting connection to ')
|
assert not l1.daemon.is_in_log(r'lightningd: attempting connection to ')
|
||||||
|
|
||||||
|
@ -2350,7 +2352,6 @@ def test_gossip_seeker_autoconnect(node_factory):
|
||||||
del l1.daemon.opts['autoconnect-seeker-peers']
|
del l1.daemon.opts['autoconnect-seeker-peers']
|
||||||
l1.restart()
|
l1.restart()
|
||||||
# L1 and L3 should autoconnect with valid node announcement connection addresses.
|
# L1 and L3 should autoconnect with valid node announcement connection addresses.
|
||||||
l1.daemon.wait_for_log('gossipd: seeker: need more peers for gossip')
|
|
||||||
l1.daemon.wait_for_log(r'lightningd: attempting connection to '
|
l1.daemon.wait_for_log(r'lightningd: attempting connection to '
|
||||||
rf'{l3.info["id"]} for additional gossip')
|
rf'{l3.info["id"]} for additional gossip')
|
||||||
l1.daemon.wait_for_log('gossipd: seeker: starting gossip')
|
l1.daemon.wait_for_log('gossipd: seeker: starting gossip')
|
||||||
|
|
Loading…
Add table
Reference in a new issue