From f673ca49817860a3952ddfce45a36791c761ff48 Mon Sep 17 00:00:00 2001 From: valentin-dimov <143783161+valentin-dimov@users.noreply.github.com> Date: Mon, 4 Dec 2023 11:20:14 +0100 Subject: [PATCH] fix: Probe module waits for ready signal in another thread to avoid hangs (#108) NOTE: This may not be a full fix, as asyncio objects technically aren't thread-safe, but it works well enough for now. Signed-off-by: Valentin Dimov --- everest-testing/src/everest/testing/core_utils/probe_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/everest-testing/src/everest/testing/core_utils/probe_module.py b/everest-testing/src/everest/testing/core_utils/probe_module.py index 13797d10..01129964 100644 --- a/everest-testing/src/everest/testing/core_utils/probe_module.py +++ b/everest-testing/src/everest/testing/core_utils/probe_module.py @@ -116,4 +116,4 @@ async def wait_to_be_ready(self, timeout=3): if not self._started: raise RuntimeError("Called wait_to_be_ready(), but probe module has not been started yet! " "Please use start() to start the module first.") - await asyncio.wait_for(self._ready_event.wait(), timeout) + await asyncio.wait_for(asyncio.to_thread(self._ready_event.wait), timeout)