Skip to content

Commit d70ed2e

Browse files
committed
fix(ci): handle transient API failures in E2E lint/unit gate polling
The 'Wait for lint and unit gate' step polls the GitHub API to check job status before running E2E tests. If the API returns truncated JSON, jq parse fails and set -Eeuo pipefail kills the step immediately. Add retry-on-failure: validate the API response with jq empty before parsing, and continue the poll loop on transient failures instead of aborting the entire E2E job. Fixes a flaky E2E failure seen on PR #132 (run 26617885011). Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent b13c472 commit d70ed2e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ jobs:
483483
echo "Waiting for lint and test-unit jobs to complete..."
484484
for i in $(seq 1 60); do
485485
jobs_json=$(gh api "repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs?per_page=100" \
486-
--jq '[.jobs[] | select(.name == "Lint" or .name == "Unit Tests") | {name: .name, status: .status, conclusion: .conclusion}]')
486+
--jq '[.jobs[] | select(.name == "Lint" or .name == "Unit Tests") | {name: .name, status: .status, conclusion: .conclusion}]') || { echo "API call failed, retrying..."; sleep 5; continue; }
487+
echo "$jobs_json" | jq empty 2>/dev/null || { echo "Malformed JSON from API, retrying..."; sleep 5; continue; }
487488
488489
all_done=true
489490
any_failed=false

0 commit comments

Comments
 (0)