From 6ce8731d698dabc94f5f35ba40c8806036c69221 Mon Sep 17 00:00:00 2001 From: guillaume Date: Tue, 23 Nov 2021 19:22:19 +0100 Subject: [PATCH] Fix infinite loop issue on container healthcheck Signed-off-by: guillaume --- stdlib/universe.bats | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/universe.bats b/stdlib/universe.bats index acac71eb..485ab84c 100644 --- a/stdlib/universe.bats +++ b/stdlib/universe.bats @@ -88,7 +88,8 @@ setup() { @test "docker run: ports" { dagger -e docker-run-ports up CONTAINER=$(docker container ls -q --filter "name=daggerci-test-ports-*") - until docker inspect --format "{{json .State.Status }}" "$CONTAINER" | grep -m 1 "running"; do sleep 1 ; done + SECONDS=0 + while [[ "$(docker inspect --format '{{json .State.Status }}' todoapp | grep -m 1 'running')" != "running" && $SECONDS -lt 45 ]]; do sleep 1 ; done run curl -f -LI http://localhost:8080 assert_output --partial '200 OK' docker stop "$CONTAINER" && docker rm "$CONTAINER"