A Copilot coding agent updates a workflow to retry a flaky integration smoke test. The repository uses the workflow as a required check before merging. Review the configuration. Evaluate the following statements. 1. The retry loop preserves a failed check after all attempts fail. 2. The job timeout bounds the retry path if the script hangs. 3. The workflow retries the entire job automatically after failure.
name: integration-smoke
on:
pull_request:
types:
- opened
- synchronize
- ready_for_review
permissions:
contents: read
jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Run smoke test with bounded retry
shell: bash
run: |
set -euo pipefail
for attempt in 1 2 3; do
echo "smoke attempt ${attempt}"
if ./scripts/smoke-test.sh; then
echo "smoke passed"
exit 0
fi
if [ "$attempt" -lt 3 ]; then
sleep $((attempt * 20))
fi
done
echo "smoke failed after retries"
exit 1Choose an answer
Tap an option to check your answer.
Correct answer: 1=Yes 2=Yes 3=No.
Why this is the answer
Statement 1 is correct because if all retry attempts within the for loop fail, the script explicitly exit 1, causing the GitHub Actions job to fail. This failure is then recorded as a failed check on the pull request. Statement 2 is correct because timeout-minutes: 15 on the smoke job ensures that if the smoke-test.sh script or any part of the retry loop hangs indefinitely, the job will be terminated after 15 minutes, preventing it from consuming excessive resources. Statement 3 is incorrect. The retry logic is implemented within a single step using a for loop in the run command. GitHub Actions does not automatically retry the entire job after a failure in this configuration. To retry the entire job, a separate GitHub Actions feature like continue-on-error combined with a workflow-level retry mechanism would be needed, which is not present here.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed