From b38cb606f4f5f20e5778212fce3e95eb03aaddbe Mon Sep 17 00:00:00 2001 From: guillaume Date: Tue, 16 Nov 2021 14:29:33 +0100 Subject: [PATCH] Fix infinite loop inside doc test + fix issue Signed-off-by: guillaume --- docs/learn/tests/doc.bats | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/learn/tests/doc.bats b/docs/learn/tests/doc.bats index a1a043e8..69faa6e7 100644 --- a/docs/learn/tests/doc.bats +++ b/docs/learn/tests/doc.bats @@ -22,11 +22,12 @@ setup() { dagger --project "$DAGGER_SANDBOX" -e 'local' up - until docker inspect --format "{{json .State.Status }}" todoapp | 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 todoapp && docker rm todoapp - docker stop registry && docker rm registry + docker stop registry-local && docker rm registry-local } @test "doc-1004-first-env" {