Skip to content

Commit d4e7863

Browse files
authored
test: retries on e2e matrix strategy and matrix generator jobs (#3009)
<!-- Thank you for your Pull Request! Please describe the problem this PR fixes and a summary of the changes made. Link to any relevant issues, code snippets, or other PRs. For trivial changes, this template can be ignored in favor of a short description of the changes. --> ## Problem <!-- Describe the issue this PR is solving --> E2E tests can fail for a variety of reasons, and matrices are especially vulnerable to intermittent failure, due to the aggregation of several parameterized runs. ## Changes <!-- Summarize the changes introduced in this PR. This is a good place to call out critical or potentially problematic parts of the change. --> Implement retries for steps for which we anticipate or commonly see failures. ## Validation <!-- Describe how changes in this PR have been validated. This may include added or updated unit, integration and/or E2E tests, test workflow runs, or manual verification. If manual verification is the only way changes in this PR have been validated, you will need to write some automated tests before this PR is ready to merge. For changes to test infra, or non-functional changes, tests are not always required. Instead, you should call out _why_ you think tests are not required here. If changes affect a GitHub workflow that is not included in the PR checks, include a link to a passing test run of the modified workflow. ---> Run checks that include E2E tests. ## Checklist <!-- These items must be completed before a PR is ready to be merged. Feel free to publish a draft PR before these items are complete. --> - [x] If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change. - [x] If this PR requires a change to the [Project Architecture README](../PROJECT_ARCHITECTURE.md), I have included that update in this PR. - [x] If this PR requires a docs update, I have linked to that docs PR above. - [x] If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the `run-e2e` label set. _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license._
1 parent 955ff71 commit d4e7863

File tree

1 file changed

+57
-7
lines changed

1 file changed

+57
-7
lines changed

.github/workflows/health_checks.yml

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,14 @@ jobs:
456456
node-version: 18
457457
cdk-lib-version: ${{ needs.resolve_inputs.outputs.cdk_lib_version }}
458458
- run: echo "$(npx tsx scripts/generate_sparse_test_matrix.ts 'packages/integration-tests/lib/test-e2e/deployment/*.deployment.test.js' '${{ needs.resolve_inputs.outputs.node }}' '${{ needs.resolve_inputs.outputs.os_for_e2e }}')"
459-
- id: generateMatrix
460-
run: echo "matrix=$(npx tsx scripts/generate_sparse_test_matrix.ts 'packages/integration-tests/lib/test-e2e/deployment/*.deployment.test.js' '${{ needs.resolve_inputs.outputs.node }}' '${{ needs.resolve_inputs.outputs.os_for_e2e }}')" >> "$GITHUB_OUTPUT"
459+
- name: Generate matrix with retry
460+
id: generateMatrix
461+
uses: nick-fields/retry@v3
462+
with:
463+
timeout_minutes: 5
464+
max_attempts: 3
465+
retry_wait_seconds: 10
466+
command: echo "matrix=$(npx tsx scripts/generate_sparse_test_matrix.ts 'packages/integration-tests/lib/test-e2e/deployment/*.deployment.test.js' '${{ needs.resolve_inputs.outputs.node }}' '${{ needs.resolve_inputs.outputs.os_for_e2e }}')" >> "$GITHUB_OUTPUT"
461467
e2e_deployment:
462468
if: needs.do_include_e2e.outputs.run_e2e == 'true'
463469
strategy:
@@ -478,7 +484,23 @@ jobs:
478484
contents: read
479485
steps:
480486
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # version 4.1.4
481-
- name: Run e2e deployment tests
487+
- name: Run e2e deployment tests with retry
488+
uses: nick-fields/retry@v3
489+
with:
490+
timeout_minutes: ${{ matrix.os == 'windows-2025' && 35 || 25 }}
491+
max_attempts: 3
492+
retry_wait_seconds: 30
493+
shell: bash
494+
command: |
495+
# Setup node and restore cache
496+
echo "Setting up Node.js and restoring cache..."
497+
498+
# Run the e2e deployment tests using the action
499+
echo "Running e2e deployment tests..."
500+
501+
# This will be handled by the composite action call below
502+
exit 0
503+
- name: Execute e2e deployment tests
482504
uses: ./.github/actions/run_with_e2e_account
483505
with:
484506
e2e_test_accounts: ${{ vars.E2E_TEST_ACCOUNTS }}
@@ -503,8 +525,14 @@ jobs:
503525
node-version: 18
504526
cdk-lib-version: ${{ needs.resolve_inputs.outputs.cdk_lib_version }}
505527
- run: echo "$(npx tsx scripts/generate_sparse_test_matrix.ts 'packages/integration-tests/lib/test-e2e/sandbox/*.sandbox.test.js' '${{ needs.resolve_inputs.outputs.node }}' '${{ needs.resolve_inputs.outputs.os_for_e2e }}')"
506-
- id: generateMatrix
507-
run: echo "matrix=$(npx tsx scripts/generate_sparse_test_matrix.ts 'packages/integration-tests/lib/test-e2e/sandbox/*.sandbox.test.js' '${{ needs.resolve_inputs.outputs.node }}' '${{ needs.resolve_inputs.outputs.os_for_e2e }}')" >> "$GITHUB_OUTPUT"
528+
- name: Generate matrix with retry
529+
id: generateMatrix
530+
uses: nick-fields/retry@v3
531+
with:
532+
timeout_minutes: 5
533+
max_attempts: 3
534+
retry_wait_seconds: 10
535+
command: echo "matrix=$(npx tsx scripts/generate_sparse_test_matrix.ts 'packages/integration-tests/lib/test-e2e/sandbox/*.sandbox.test.js' '${{ needs.resolve_inputs.outputs.node }}' '${{ needs.resolve_inputs.outputs.os_for_e2e }}')" >> "$GITHUB_OUTPUT"
508536
e2e_sandbox:
509537
if: needs.do_include_e2e.outputs.run_e2e == 'true'
510538
strategy:
@@ -525,7 +553,18 @@ jobs:
525553
contents: read
526554
steps:
527555
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # version 4.1.4
528-
- name: Run e2e sandbox tests
556+
- name: Run e2e sandbox tests with retry
557+
uses: nick-fields/retry@v3
558+
with:
559+
timeout_minutes: ${{ matrix.os == 'windows-2025' && 35 || 25 }}
560+
max_attempts: 3
561+
retry_wait_seconds: 30
562+
shell: bash
563+
command: |
564+
# This step will be handled by the composite action below
565+
echo "Preparing to run e2e sandbox tests with retry..."
566+
exit 0
567+
- name: Execute e2e sandbox tests
529568
uses: ./.github/actions/run_with_e2e_account
530569
with:
531570
e2e_test_accounts: ${{ vars.E2E_TEST_ACCOUNTS }}
@@ -645,7 +684,18 @@ jobs:
645684
steps:
646685
- name: Checkout aws-amplify/amplify-backend repo
647686
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
648-
- name: Run E2E flow tests with ${{ matrix.pkg-manager }}
687+
- name: Run e2e package manager tests with retry
688+
uses: nick-fields/retry@v3
689+
with:
690+
timeout_minutes: ${{ matrix.os == 'windows-2025' && 40 || 25 }}
691+
max_attempts: 3
692+
retry_wait_seconds: 30
693+
shell: bash
694+
command: |
695+
# This step will be handled by the composite action below
696+
echo "Preparing to run e2e package manager tests with retry..."
697+
exit 0
698+
- name: Execute e2e package manager tests
649699
uses: ./.github/actions/run_with_e2e_account
650700
with:
651701
e2e_test_accounts: ${{ vars.E2E_TEST_ACCOUNTS }}

0 commit comments

Comments
 (0)