Skip to content

Commit 9b4a0c1

Browse files
fix: pass the timeout when we are waiting a node to start
Thsi fix a bug that was reported with slower machine the core lightning is not fast enought to start and so it fails. This PR allow to pass a custom timeout to the wait_for function. ``` self = <pyln.client.lightning.UnixSocket object at 0x7ff95de096c0> def connect(self) -> None: try: self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) > self.sock.connect(str(self.path)) E FileNotFoundError: [Errno 2] No such file or directory ../../../../anaconda3/envs/lnpro/lib/python3.10/site-packages/pyln/client/lightning.py:234: FileNotFoundError ------------------------------ Captured log call ------------------------------- ERROR root:clightning.py:441 Short read reading the message length: 18 != 0 ERROR root:clightning.py:441 Short read reading the message length: 18 != 0 =========================== short test summary info ============================ FAILED tests/test_bolt1-01-init.py::test_init_fail_ask_for_option_data_loss_protect - FileNotFoundError: [Errno 2] No such file or directory ``` Link: https://discord.com/channels/899980449231814676/941465665540325397/1112049895008899173 Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 554659f commit 9b4a0c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lnprototest/clightning/clightning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from lnprototest import wait_for
3434
from typing import Dict, Any, Callable, List, Optional, cast
3535

36-
TIMEOUT = int(os.getenv("TIMEOUT", "30"))
36+
TIMEOUT = int(os.getenv("TIMEOUT", "60"))
3737
LIGHTNING_SRC = os.path.join(os.getcwd(), os.getenv("LIGHTNING_SRC", "../lightning/"))
3838

3939

@@ -175,7 +175,7 @@ def node_ready(rpc: pyln.client.LightningRpc) -> bool:
175175
logging.debug(f"waiting for core-lightning: Exception received {ex}")
176176
return False
177177

178-
wait_for(lambda: node_ready(self.rpc))
178+
wait_for(lambda: node_ready(self.rpc), timeout=TIMEOUT)
179179
logging.debug("Waited for core-lightning")
180180

181181
# Make sure that we see any funds that come to our wallet

0 commit comments

Comments
 (0)