Skip to content

Commit

Permalink
Make sure driver is polled for status
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Nov 26, 2024
1 parent 0197524 commit 7faf381
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/everest/detached/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import importlib
import json
import logging
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 7faf381

Please sign in to comment.