From 15107e72c5ef54d285184eb76ed7aebf981f7490 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Fri, 6 Oct 2023 09:51:55 +0100 Subject: [PATCH] fix(ci): use better approach --- .github/workflows/sub-deploy-integration-tests-gcp.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sub-deploy-integration-tests-gcp.yml b/.github/workflows/sub-deploy-integration-tests-gcp.yml index 27bee656851..65d68e71c02 100644 --- a/.github/workflows/sub-deploy-integration-tests-gcp.yml +++ b/.github/workflows/sub-deploy-integration-tests-gcp.yml @@ -291,6 +291,10 @@ jobs: --ssh-flag="-o ConnectTimeout=5" \ --command \ "\ + while [[ ! -e /dev/sdb ]] || sudo lsof /dev/sdb &>/dev/null do \ + echo 'Waiting for /dev/sdb to be free...'; \ + sleep 10; \ + done; \ # Check if we need to format the disk if no state is needed if [[ "${{ inputs.needs_zebra_state }}" == "false" && "${{ inputs.needs_lwd_state }}" == "false" ]]; then sudo mkfs.ext4 -v /dev/sdb @@ -345,8 +349,6 @@ jobs: --ssh-flag="-o ConnectTimeout=5" \ --command \ "\ - # Wait for the disk to be attached - while [[ ! -e /dev/sdb ]]; do sleep 1; done && \ sudo docker run \ --name ${{ inputs.test_id }} \ --tty \ @@ -398,7 +400,7 @@ jobs: # with that status. # (`docker wait` can also wait for multiple containers, but we only ever wait for a single container.) - name: Result of ${{ inputs.test_id }} test - shell: /usr/bin/bash -exo pipefail && trap '' PIPE && {0} + shell: /usr/bin/bash -exo pipefail {0} run: | gcloud compute ssh ${{ inputs.test_id }}-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \ --zone ${{ vars.GCP_ZONE }} \