From 745a44afafadb873b51e166dcea42ce6577b9c56 Mon Sep 17 00:00:00 2001 From: Jason Aricheta Date: Fri, 3 Jul 2026 16:44:52 +1200 Subject: [PATCH] test: cover startup timeout and cancellation --- .github/workflows/aws-runner-e2e.yml | 30 ++++++++++++++++++++++++++-- docs/testing.md | 8 +++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/aws-runner-e2e.yml b/.github/workflows/aws-runner-e2e.yml index f9cb718..34bd667 100644 --- a/.github/workflows/aws-runner-e2e.yml +++ b/.github/workflows/aws-runner-e2e.yml @@ -11,6 +11,8 @@ on: options: - success - failure + - cancellation + - startup-timeout - maximum-duration permissions: @@ -33,6 +35,7 @@ jobs: aws-region: ${{ vars.MICROVM_AWS_REGION }} - uses: ./ id: start + continue-on-error: ${{ inputs.scenario == 'startup-timeout' }} with: mode: start github-token: ${{ secrets.RUNNER_E2E_TOKEN }} @@ -42,10 +45,29 @@ jobs: cloudwatch-log-group: ${{ vars.MICROVM_RUNTIME_LOG_GROUP }} runner-labels: lambda-microvm,docker,e2e maximum-duration-seconds: - ${{ inputs.scenario == 'maximum-duration' && '60' || '900' }} + ${{ inputs.scenario == 'maximum-duration' && '60' || inputs.scenario + == 'cancellation' && '180' || '900' }} + startup-timeout-seconds: + ${{ inputs.scenario == 'startup-timeout' && '45' || '180' }} + egress-connectors: + ${{ inputs.scenario == 'startup-timeout' && '[]' || + 'INTERNET_EGRESS' }} + - name: Verify expected startup outcome + if: always() + env: + EXPECTED_FAILURE: ${{ inputs.scenario == 'startup-timeout' }} + START_OUTCOME: ${{ steps.start.outcome }} + run: | + if [[ "${EXPECTED_FAILURE}" == "true" ]]; then + test "${START_OUTCOME}" = "failure" + else + test "${START_OUTCOME}" = "success" + fi target: - if: inputs.scenario != 'maximum-duration' + if: + inputs.scenario != 'maximum-duration' && inputs.scenario != + 'startup-timeout' needs: start-runner runs-on: ${{ needs.start-runner.outputs.label }} timeout-minutes: 15 @@ -121,6 +143,10 @@ jobs: if: inputs.scenario == 'failure' run: exit 1 + - name: Wait for cancellation + if: inputs.scenario == 'cancellation' + run: sleep 300 + duration-audit: if: inputs.scenario == 'maximum-duration' needs: start-runner diff --git a/docs/testing.md b/docs/testing.md index b5725a7..fdbcaad 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -44,10 +44,12 @@ Every candidate version must prove in AWS: The manual `.github/workflows/aws-runner-e2e.yml` workflow exercises the production three-job pattern through the GitHub OIDC role. Set a temporary `RUNNER_E2E_TOKEN` repository secret with Administration read/write permission, -then run its `success`, `failure`, and `maximum-duration` scenarios. Remove the +then run its `success`, `failure`, `startup-timeout`, and `maximum-duration` +scenarios. For `cancellation`, cancel the run while its target waits. Remove the secret after testing. The workflow verifies checkout, the ARM64 host, Docker, -Buildx, Compose, service containers, DNS, egress, failure cleanup, idempotent -stop, and the platform duration backstop. +Buildx, Compose, service containers, DNS, egress, partial-start cleanup, job +failure and cancellation cleanup, idempotent stop, and the platform duration +backstop. The lower-level `.github/workflows/aws-runner-target.yml` job remains available for a runner launched outside GitHub Actions. It waits for a runner with the