mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
tests: test for stopping node while it's starting.
In CI we see crashes in this case: ``` lightningd: lightningd/connect_control.c:734: void connectd_activate(struct lightningd *): Assertion `ret == ld->connectd' failed. ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Vincenzo Palazzo
parent
efeb030eef
commit
30335e1dc3
@@ -3237,3 +3237,23 @@ def test_create_gossip_mesh(node_factory, bitcoind):
|
|||||||
print("nodeids", nodeids)
|
print("nodeids", nodeids)
|
||||||
print("scids", scids)
|
print("scids", scids)
|
||||||
assert False, "Test failed on purpose, grab the gossip store from /tmp/ltests-..."
|
assert False, "Test failed on purpose, grab the gossip store from /tmp/ltests-..."
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(strict=True)
|
||||||
|
def test_fast_shutdown(node_factory):
|
||||||
|
l1 = node_factory.get_node(start=False)
|
||||||
|
|
||||||
|
l1.daemon.start(wait_for_initialized=False)
|
||||||
|
|
||||||
|
start_time = time.time()
|
||||||
|
# Keep trying until this succeeds (socket may not exist yet!)
|
||||||
|
while True:
|
||||||
|
if time.time() > start_time + TIMEOUT:
|
||||||
|
raise ValueError("Timeout while waiting for stop to work!")
|
||||||
|
try:
|
||||||
|
l1.rpc.stop()
|
||||||
|
except FileNotFoundError:
|
||||||
|
continue
|
||||||
|
except ConnectionRefusedError:
|
||||||
|
continue
|
||||||
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user