From 41dc53b7f86d7c6f84898fa3f9e9368ac286fe32 Mon Sep 17 00:00:00 2001 From: Josh Siviour Date: Thu, 18 Jun 2026 20:58:32 +1000 Subject: [PATCH] fix(ci): prevent stale suite-status from false-failing e2e re-runs (#387) The per-run ARTIFACT_DIR lives in /tmp, outside GITHUB_WORKSPACE, so a re-run on the same self-hosted runner reused a prior attempt's append-only suite-status.txt. The 'Fail job if any suite failed' gate's -s check then failed the job even when the surviving attempt passed with rc=0. Wipe ARTIFACT_DIR in Clean Workspace and gate solely on the per-attempt steps.e2e.outputs.rc (fail-closed: an empty rc still fails). --- .github/workflows/e2e.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 7946d3cf1..62fcb38bc 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -107,6 +107,10 @@ jobs: awk -v w="$GITHUB_WORKSPACE" '$2 ~ "^"w {print $2}' /proc/mounts \ | sort -r | xargs -r -I{} sudo umount -l -R {} || true sudo rm -rf --one-file-system "$GITHUB_WORKSPACE"/* + # ARTIFACT_DIR lives in /tmp, outside the workspace, so a re-run on + # the same self-hosted runner reuses it. Wipe it so a prior attempt's + # stale suite-status.txt / analysis dirs can't leak into this attempt. + rm -rf "${ARTIFACT_DIR}" - uses: actions/create-github-app-token@v3 id: app-token @@ -463,7 +467,7 @@ jobs: - name: Fail job if any suite failed if: always() run: | - if [ "${{ steps.e2e.outputs.rc }}" != "0" ] || [ -s "${ARTIFACT_DIR}/suite-status.txt" ]; then + if [ "${{ steps.e2e.outputs.rc }}" != "0" ]; then echo "::error::E2E suites failed (rc=${{ steps.e2e.outputs.rc }})" cat "${ARTIFACT_DIR}/suite-status.txt" 2>/dev/null || true exit 1 @@ -503,6 +507,10 @@ jobs: awk -v w="$GITHUB_WORKSPACE" '$2 ~ "^"w {print $2}' /proc/mounts \ | sort -r | xargs -r -I{} sudo umount -l -R {} || true sudo rm -rf --one-file-system "$GITHUB_WORKSPACE"/* + # ARTIFACT_DIR lives in /tmp, outside the workspace, so a re-run on + # the same self-hosted runner reuses it. Wipe it so a prior attempt's + # stale suite-status.txt / analysis dirs can't leak into this attempt. + rm -rf "${ARTIFACT_DIR}" - uses: actions/create-github-app-token@v3 id: app-token @@ -876,7 +884,7 @@ jobs: - name: Fail job if any suite failed if: always() run: | - if [ "${{ steps.e2e.outputs.rc }}" != "0" ] || [ -s "${ARTIFACT_DIR}/suite-status.txt" ]; then + if [ "${{ steps.e2e.outputs.rc }}" != "0" ]; then echo "::error::Multi-node E2E suites failed (rc=${{ steps.e2e.outputs.rc }})" cat "${ARTIFACT_DIR}/suite-status.txt" 2>/dev/null || true exit 1