From 4d8c24b812ffbc6fcde5d7ee8dc588a410db1fcb Mon Sep 17 00:00:00 2001 From: Matus Kasak Date: Thu, 19 Nov 2026 17:00:18 +0100 Subject: [PATCH] Wait until the instance answers before the UI tests docker compose up -d returns as soon as the containers start, so the Playwright run that follows the deploy hit an instance that was still starting and its first specs failed. deploy-8633 now waits until the REST API and the UI both return 200 (up to 15 minutes). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/deploy.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 356a1f523be..36465a94d0d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -206,6 +206,20 @@ jobs: cd ../.. docker compose --env-file $ENVFILE -p dspace-$INSTANCE -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f $CONFIG_PATH/docker-compose-rest.yml -f $CONFIG_PATH/docker-compose.yml -f $CONFIG_PATH/extra.yml up -d --no-build --remove-orphans + # docker compose returns as soon as the containers start, long before DSpace answers. + # Without this wait the UI tests that follow start too early and their first specs fail. + - name: wait until the instance answers + timeout-minutes: 15 + run: | + BASE_URL="http://${{ inputs.DEV_MACHINE }}.pc:$INSTANCE/repository" + for url in "$BASE_URL/server/api" "$BASE_URL/"; do + echo "Waiting for $url" + until [ "$(curl -sL -o /dev/null -w '%{http_code}' --max-time 30 "$url")" = "200" ]; do + sleep 10 + done + echo "$url -> 200" + done + import-8633: runs-on: dspace-${{inputs.DEV_MACHINE}}-dep-1 if: inputs.IMPORT