From 9cb83517cd887c88051d3f4e77785eb9ed8451af Mon Sep 17 00:00:00 2001 From: Sergey Vasilyev Date: Fri, 19 Jan 2024 21:37:00 +0100 Subject: [PATCH] Escalate the liveness server/runner errors in tests instead of eternal waiting Signed-off-by: Sergey Vasilyev --- tests/test_liveness.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_liveness.py b/tests/test_liveness.py index 35cc578f..47cc8ead 100644 --- a/tests/test_liveness.py +++ b/tests/test_liveness.py @@ -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()