From d620e5aa2a8aadf6be7e2df41b9fc61e2ce81a52 Mon Sep 17 00:00:00 2001 From: ix5 Date: Mon, 29 Apr 2024 00:27:37 +0200 Subject: [PATCH] .github/e2e: Make health checks more robust --- .github/workflows/e2e-tests.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index bb3baf0d..d3e5c33e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -41,14 +41,16 @@ jobs: run: docker compose build isso-server - name: Bring up containers + # Don't wait for healthcheck via --wait. This would fail with a + # negative exit code since the isso-client container is expected to + # exit run: docker compose up -d - name: Client unit tests run: make docker-js-unit - - name: Check if containers are up, sleep if not - shell: bash - run: '[ "$(docker inspect --format={{.State.Health.Status}} isso-server)" = "healthy" ] || sleep 5' + - name: Wait for isso-server container to be ready + run: '(r=5;while ! `docker inspect -f {{.State.Health.Status}} isso-server`"=="healthy" ; do ((--r))||exit 1;sleep 1;done)' - name: Client integration tests run: make docker-js-integration