diff --git a/libs/gl-testing/tests/test_lsps.py b/libs/gl-testing/tests/test_lsps.py index fe8384815..9fa3a1eda 100644 --- a/libs/gl-testing/tests/test_lsps.py +++ b/libs/gl-testing/tests/test_lsps.py @@ -3,6 +3,7 @@ import json from glclient.lsps import ProtocolList +import time import threading @@ -34,6 +35,7 @@ def wrap_function(*args, **kwargs): self._thread = threading.Thread(target=wrap_function, args=args, kwargs=kwargs) self._thread.start() + def await_result(self, timeout_seconds : float=30.0): self._thread.join(timeout=timeout_seconds) if self._thread.is_alive(): @@ -68,6 +70,10 @@ def test_lsps_list_protocol(clients : Clients, node_factory : NodeFactory, bitco json_rpc_id = "abcdef" protocol_fut = AwaitResult(lambda: lsp_client.list_protocols(json_rpc_id=json_rpc_id)) + # The sleep ensures the lsp-client has actually send the message and is ready to receive + # the response + time.sleep(1.0) + # The n1.rpc.sendcustommsg expects that both the node_id and msg are hex encoded strings msg_content = { "jsonrpc" : "2.0",