Skip to content

Commit

Permalink
Escalate the liveness server/runner errors in tests instead of eterna…
Browse files Browse the repository at this point in the history
…l waiting

Signed-off-by: Sergey Vasilyev <[email protected]>
  • Loading branch information
nolar committed Jan 19, 2024
1 parent acfd5fc commit 9cb8351
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_liveness.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ async def liveness_url(settings, liveness_registry, unused_tcp_port_factory):
)
)

# Generally there is no or minimal timeout, except if the runner/server raise on start up.
# In that case, escalate their error from the task instead of hanging here forever.
try:
await ready_flag.wait()
await asyncio.wait_for(ready_flag.wait(), timeout=1)
yield f'http://localhost:{port}/xyz'
finally:
server.cancel()
Expand Down

0 comments on commit 9cb8351

Please sign in to comment.