From e158c2231da23d76e1d81626d4ed117faf9db5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Eide?= Date: Tue, 26 Nov 2024 12:03:40 +0100 Subject: [PATCH] Make sure driver is polled for status --- src/everest/detached/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/everest/detached/__init__.py b/src/everest/detached/__init__.py index d4ec6c83e0d..c383a6e946c 100644 --- a/src/everest/detached/__init__.py +++ b/src/everest/detached/__init__.py @@ -1,3 +1,4 @@ +import asyncio import importlib import json import logging @@ -58,12 +59,15 @@ async def start_server(config: EverestConfig, debug: bool = False) -> Driver: args = ["--config-file", str(config.config_path)] if debug: args.append("--debug") + poll_task = asyncio.create_task(driver.poll(), name="poll_task") await driver.submit(0, "everserver", *args) except FailedSubmit as err: raise ValueError(f"Failed to submit Everserver with error: {err}") from err status = await driver.event_queue.get() if not isinstance(status, StartedEvent): + poll_task.cancel() raise ValueError(f"Everserver not started as expected, got status: {status}") + poll_task.cancel() return driver