diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35cf8d405d..fef2f61772 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -331,8 +331,8 @@ jobs: needs: changeset if: ${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.runtime_host == 'true' }} runs-on: ubuntu-24.04 - # 12 minutes setup + unchanged 15 minutes proof + 3 minutes for other steps (#2658). - timeout-minutes: 30 + # 12 minutes setup + 45 minutes proof + 3 minutes for other steps (#2658, #4242). + timeout-minutes: 60 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: @@ -363,7 +363,9 @@ jobs: run: sudo python3 -I -S scripts/native-proof/loop-trace.py start tmp/native-host-proof/owned-loop-trace.json - name: Complete native hosted runtime proof id: runtime_proof - timeout-minutes: 15 + # A hang catch-all, not a product timing: green proof took 596-810 s + # over 37 main runs, so 15 minutes cut off a slow runner (#4242). + timeout-minutes: 45 run: bun scripts/ci-proof.ts runtime_host - name: Stop optional owned-loop kernel trace continue-on-error: true @@ -382,7 +384,7 @@ jobs: SETUP_OUTCOME: ${{ steps.runtime_setup.outcome }} PROOF_OUTCOME: ${{ steps.runtime_proof.outcome }} run: | - printf 'Environment setup (infrastructure prerequisite, 12-minute limit): %s\nProof (15-minute limit): %s\n' \ + printf 'Environment setup (infrastructure prerequisite, 12-minute limit): %s\nProof (45-minute limit): %s\n' \ "$SETUP_OUTCOME" "$PROOF_OUTCOME" >> "$GITHUB_STEP_SUMMARY" - name: Proof receipts and failure diagnostics if: always() diff --git a/.github/workflows/heavy-feedback.yml b/.github/workflows/heavy-feedback.yml index d33831c016..5f036d0069 100644 --- a/.github/workflows/heavy-feedback.yml +++ b/.github/workflows/heavy-feedback.yml @@ -249,7 +249,7 @@ jobs: needs: changeset if: "${{ !cancelled() && (needs.changeset.result == 'success' || github.event_name == 'push') && needs.changeset.outputs.runtime_host == 'true' }}" runs-on: ubuntu-24.04 - timeout-minutes: 30 + timeout-minutes: 60 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: @@ -277,7 +277,7 @@ jobs: run: sudo python3 -I -S scripts/native-proof/loop-trace.py start tmp/native-host-proof/owned-loop-trace.json - name: Complete native hosted runtime proof id: runtime_proof - timeout-minutes: 15 + timeout-minutes: 45 run: bun scripts/ci-proof.ts runtime_host - name: Stop optional owned-loop kernel trace continue-on-error: true @@ -291,7 +291,7 @@ jobs: env: SETUP_OUTCOME: "${{ steps.runtime_setup.outcome }}" PROOF_OUTCOME: "${{ steps.runtime_proof.outcome }}" - run: "printf 'Environment setup (infrastructure prerequisite, 12-minute limit): %s\\nProof (15-minute limit): %s\\n' \\\n \"$SETUP_OUTCOME\" \"$PROOF_OUTCOME\" >> \"$GITHUB_STEP_SUMMARY\"\n" + run: "printf 'Environment setup (infrastructure prerequisite, 12-minute limit): %s\\nProof (45-minute limit): %s\\n' \\\n \"$SETUP_OUTCOME\" \"$PROOF_OUTCOME\" >> \"$GITHUB_STEP_SUMMARY\"\n" - name: Proof receipts and failure diagnostics if: always() uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 diff --git a/docs/decisions/ci-utility.md b/docs/decisions/ci-utility.md index 3cce314803..3195974f18 100644 --- a/docs/decisions/ci-utility.md +++ b/docs/decisions/ci-utility.md @@ -580,12 +580,14 @@ describe the 6 min 32 s attempt; they are not independent measurements. Every workflow call to `ci-runtime-setup.sh` now has a 12-minute step limit. This leaves 3 min 8 s above the longest reported setup, bounding mirror stalls -without spending the proof allowance. The proof steps explicitly retain the +without spending the proof allowance. The proof steps retained the former job ceilings: 15 minutes for `runtime` and `runtime_host`, and 30 minutes -for each `unit` partition under #1485. Job limits are the sum of setup and +for each `unit` partition under #1485. `runtime_host` proof now has 45 minutes +([a step limit is a watchdog](#a-job-step-limit-is-a-watchdog-too), #4242). +Job limits are the sum of setup and proof plus three minutes for checkout, dependency install, planning, tracing, -summaries and artifact upload: 30 minutes for either runtime job and 45 minutes -for unit. In the supplied successful and slow logs, checkout/install/planning +summaries and artifact upload: 30 minutes for `runtime`, 60 minutes for +`runtime_host` and 45 minutes for unit. In the supplied successful and slow logs, checkout/install/planning plus trace startup took less than 30 seconds, so this reserve has margin; it is finite, not a guarantee against arbitrarily stalled unrelated steps. @@ -2420,6 +2422,23 @@ cap is enough for almost every test. A tripped watchdog on a slow run is raised or scaled. It is not a failed proof, and the work is not squeezed to fit under it. +### A job step limit is a watchdog too + +A workflow step's `timeout-minutes` is the same kind of number: it stops a +hung job, and a pass says nothing about it. It is sized the same way. + +`runtime_host` proof had 15 minutes. Over the 37 green main runs before +2026-11-17 22:52 UTC its proof step took 596 to 810 seconds, median 617: the +slowest used 90% of the limit. Main run +[44184262171](https://github.com/schlessera/brain-kit/actions/runs/44184262171) +hit it at the third of its three commands +([#4242](https://github.com/schlessera/brain-kit/issues/4242)). The run was +slow throughout, not stuck. Its first two commands took 549 and 290 seconds, +against 360 to 444 and 199 to 244 in green runs, and the third was still +printing progress when the limit stopped it. The step now has 45 minutes, +about 3.3 times the slowest green run, and the job 60. `runtime` proof, at +117 to 208 seconds over 38 runs, keeps its 15. + ### The gate scales deadlines by a fixed factor Under the `determinism` job every test deadline the job can reach is diff --git a/docs/process/testing.md b/docs/process/testing.md index 82cc55dbf1..c6ee906300 100644 --- a/docs/process/testing.md +++ b/docs/process/testing.md @@ -950,10 +950,11 @@ Workflows reference each action by commit, with its release tag as a comment: tag and commit. Environment setup via `scripts/ci-runtime-setup.sh` has its own 12-minute -step limit in `unit`, `runtime`, `runtime_host` and `determinism`. Proof retains a separate -30-minute unit allowance or 15-minute runtime allowance. The job caps are -45 and 30 minutes respectively, including three minutes for the remaining -steps. The [timeout basis](../decisions/ci-utility.md#separate-environment-setup-and-proof-budgets) +step limit in `unit`, `runtime`, `runtime_host` and `determinism`. Proof has a separate +allowance: 30 minutes for unit, 15 for `runtime` and 45 for `runtime_host`. +The job caps are 45, 30 and 60 minutes respectively, including three minutes +for the remaining steps. A step limit is a watchdog: it is raised when green +runs come near it ([#4242](../decisions/ci-utility.md#a-job-step-limit-is-a-watchdog-too)). The [timeout basis](../decisions/ci-utility.md#separate-environment-setup-and-proof-budgets) records the slow-mirror observations and margin. Each job always reports setup and proof outcomes separately in its summary: setup failure/cancellation is an infrastructure prerequisite failure with proof skipped, while proof failure diff --git a/scripts/check-ci-workflows.ts b/scripts/check-ci-workflows.ts index d93d3f36ed..55615251c8 100644 --- a/scripts/check-ci-workflows.ts +++ b/scripts/check-ci-workflows.ts @@ -81,7 +81,7 @@ export function workflowProblems(text: string, file: string): string[] { fail("verify: always summary must separate raw install, planning and proof outcomes and receipts"); // Network prerequisites cannot spend proof capacity; measured basis: docs/decisions/ci-utility.md (#2658). // Repeated changed tests need the unit job's prerequisites: they may drive real Chrome (#4109). - for (const [name, proofMinutes] of [["unit", 30], ["runtime", 15], ["runtime_host", 15], ["determinism", DETERMINISM_PARTITIONS.stepMinutes]] as const) { + for (const [name, proofMinutes] of [["unit", 30], ["runtime", 15], ["runtime_host", 45], ["determinism", DETERMINISM_PARTITIONS.stepMinutes]] as const) { const job = workflow.jobs?.[name]; const setup = job?.steps?.find(step => step.run === `bash scripts/ci-runtime-setup.sh${name === "unit" || name === "determinism" ? "" : " --native"}`); const command = `bun scripts/ci-proof.ts ${name}`; diff --git a/tests/ci-workflows.test.ts b/tests/ci-workflows.test.ts index 301915c4b1..3af10e9414 100644 --- a/tests/ci-workflows.test.ts +++ b/tests/ci-workflows.test.ts @@ -168,7 +168,7 @@ describe("the authoritative jobs retain their important phases", () => { }); describe("runtime environment setup and proof budgets", () => { - for (const [name, proofMinutes] of [["unit", 30], ["runtime", 15], ["runtime_host", 15], ["determinism", 40]] as const) { + for (const [name, proofMinutes] of [["unit", 30], ["runtime", 15], ["runtime_host", 45], ["determinism", 40]] as const) { const job = ci.jobs[name]!; // Repeated changed tests share the unit job's prerequisites, not the native ones (#4109). const setup = job.steps.find(s => s.run === `bash scripts/ci-runtime-setup.sh${name === "unit" || name === "determinism" ? "" : " --native"}`)!;