From 4f195c97ebf2733f46eff0f3924373a3102ee799 Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Mon, 16 Nov 2026 17:19:10 -0500 Subject: [PATCH 1/2] CI: Rust tests can no longer hold the runner for an hour Five times since 13 November the Rust (tests) job lost its runner during the first cargo step and failed after 55 minutes with no log; reruns passed. That step built the whole workspace with full debug info (about 19 GB of target, close to 14 GB of compiler memory at four jobs) and then ran the suite. - The job builds with line-tables debug info: file:line stays in panics and backtraces, at about a third of the disk and build time. - The build is its own step, printing disk and memory every minute. - Every test step runs through cargo-nextest: each test in its own process, ended and failed under its own name after two minutes (services/.config/nextest.toml). Each step has a time limit as a backstop. - q_run_ceiling built 100,000 DynamoDB clients in one test (a minute of CPU, the slowest test in the suite); it now builds one per scenario. --- .github/workflows/ci.yml | 43 ++++++++++++++++--- docs/incidents.md | 5 ++- services/.config/nextest.toml | 11 +++++ services/worker/src/passes/incidents/mod.rs | 2 +- .../src/passes/incidents/q_run_ceiling.rs | 19 +++++--- 5 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 services/.config/nextest.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba106b67b..673c4d538 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,6 +93,15 @@ jobs: rust-test: name: Rust (tests) runs-on: ubuntu-latest + # Five times since 13 November the runner stopped answering during the + # first cargo step and GitHub failed the job after 55 minutes as "lost + # communication": no test log, and every rerun passed. That step built + # the whole workspace with full debug info: about 19 GB of target and + # close to 14 GB of compiler memory at four jobs, on a runner with 16 GB + # and a few tens of GB of free disk. Line tables keep file:line in panics + # and backtraces at about a third of the disk and build time. + env: + CARGO_PROFILE_DEV_DEBUG: line-tables-only defaults: run: working-directory: services @@ -123,27 +132,51 @@ jobs: with: workspaces: services cache-on-failure: true + # Each test in its own process, ended and failed under its own name + # after two minutes (services/.config/nextest.toml). + - if: steps.changes.outputs.run == 'true' + uses: taiki-e/install-action@1919c4a95903d2c33e4a221102edca87309fc14b # v2.89.0 + with: + tool: cargo-nextest@0.9.151 + # The build on its own step, with its own time limit. --workspace + # everywhere: one feature set, so one build (`-p worker` alone resolves + # features differently and compiles everything again). + # Disk and memory every minute while it builds, so a runner that runs + # out of either says so in the log. + - name: Build tests + if: steps.changes.outputs.run == 'true' + timeout-minutes: 30 + run: | + usage() { echo "$(date -u +%T) disk free $(df -h --output=avail / | tail -1 | tr -d ' '), memory used $(free -m | awk '/^Mem/{print $3 " of " $2 " MB"}')"; } + usage + (while sleep 60; do usage; done) & + cargo test --workspace --no-run + usage # Every run failure that reached a person, replayed through the # pipeline's decision code with fakes only at the edges # (docs/incidents.md). Its own step, so a regression names itself. - # --workspace on both steps: one feature set, so one build (`-p worker` - # alone resolves features differently and compiles everything again). - name: Incident regressions if: steps.changes.outputs.run == 'true' - run: cargo test --workspace -- 'incidents::' + timeout-minutes: 10 + run: cargo nextest run --workspace --no-fail-fast -E 'test(/incidents::/)' # Stops, asks, blocks and loops replayed through the real decision # functions and graded on the decision, with the stop judge's recorded # answers k = 3 times each (pass^k; passes/replay/README.md). It gates # any prompt, model or effort change to a judgment step. - name: Replay suite if: steps.changes.outputs.run == 'true' - run: cargo test --workspace -- 'replay::' + timeout-minutes: 10 + run: cargo nextest run --workspace --no-fail-fast -E 'test(/replay::/)' # Includes the reviewer evals (worker passes::review_eval): recorded # review histories replayed through the real decision code, no model. # The incident and replay suites already ran above, on the same build. + # nextest runs no doc tests, so cargo test runs those. - name: Workspace tests if: steps.changes.outputs.run == 'true' - run: cargo test --workspace -- --skip 'incidents::' --skip 'replay::' + timeout-minutes: 15 + run: | + cargo nextest run --workspace --no-fail-fast -E 'not (test(/incidents::/) | test(/replay::/))' + cargo test --workspace --doc rust: name: Rust (workspace) diff --git a/docs/incidents.md b/docs/incidents.md index 42d96bcc4..72d34d785 100644 --- a/docs/incidents.md +++ b/docs/incidents.md @@ -3,7 +3,10 @@ Every run failure that reached a person is a case in `services/worker/src/passes/incidents/`, so it can't come back without a failing test. CI runs the suite as its own step, **Incident regressions** in **Rust (tests)** -(`cargo test --workspace -- incidents::`), on every pull request. +(`cargo nextest run --workspace -E 'test(/incidents::/)'`; locally, +`cargo test --workspace -- incidents::` runs the same tests), on every pull +request. A case still running after two minutes fails under its own name +(`services/.config/nextest.toml`). Each case replays the failure on one invented monorepo: diff --git a/services/.config/nextest.toml b/services/.config/nextest.toml new file mode 100644 index 000000000..1cbe118c9 --- /dev/null +++ b/services/.config/nextest.toml @@ -0,0 +1,11 @@ +# cargo-nextest settings for the workspace (CI runs every Rust test step +# through it; see .github/workflows/ci.yml). +# +# Each test runs in its own process, and one still running after two minutes +# is ended and reported as failed under its own name, so a test that hangs +# fails the step in minutes instead of holding the runner for an hour. The +# slowest test in the workspace takes a few seconds. + +[profile.default] +slow-timeout = { period = "30s", terminate-after = 4 } +fail-fast = false diff --git a/services/worker/src/passes/incidents/mod.rs b/services/worker/src/passes/incidents/mod.rs index 0849ab389..893c45b6a 100644 --- a/services/worker/src/passes/incidents/mod.rs +++ b/services/worker/src/passes/incidents/mod.rs @@ -9,7 +9,7 @@ //! never appears. Where a decision lives inside the pipeline itself, the //! case also checks that the pipeline still calls it at that place. //! -//! CI runs the suite as its own job (`cargo test -p worker incidents::`), +//! CI runs the suite as its own step (`docs/incidents.md` has the command), //! and `docs/incidents.md` lists each case with the guarantee it protects. //! A fix for a new failure adds a case here and a line there. diff --git a/services/worker/src/passes/incidents/q_run_ceiling.rs b/services/worker/src/passes/incidents/q_run_ceiling.rs index ddd7c3295..8565f6ee3 100644 --- a/services/worker/src/passes/incidents/q_run_ceiling.rs +++ b/services/worker/src/passes/incidents/q_run_ceiling.rs @@ -113,6 +113,18 @@ enum Ended { async fn adversary(message: &WorkerMessage, pass: &str, layers: Layers) -> (Ended, Totals) { let record = Record::default(); let usd_per_step = 4.0; + // One meter for every step: building an SDK client is the costly part, + // and 100,000 of them took a minute of the CI runner's CPU. No team, so + // `admit` asks nothing outside: only the allowance. + let meter = common::usage::UsageMeter::dynamo( + aws_sdk_dynamodb::Client::from_conf( + aws_sdk_dynamodb::Config::builder() + .behavior_version_latest() + .build(), + ), + "", + "", + ); for _ in 0..100_000u32 { if layers.entry && !admit(&record, message).await { assert_eq!(*record.ended_by_entry.borrow(), 1); @@ -128,13 +140,6 @@ async fn adversary(message: &WorkerMessage, pass: &str, layers: Layers) -> (Ende })); let refused = common::usage::with_run_allowance(allowance, async { // A step's calls: refused once the allowance is spent. - let client = aws_sdk_dynamodb::Client::from_conf( - aws_sdk_dynamodb::Config::builder() - .behavior_version_latest() - .build(), - ); - // No team, so `admit` asks nothing outside: only the allowance. - let meter = common::usage::UsageMeter::dynamo(client, "", ""); for _ in 0..4 { if meter.admit().await.is_err() { return true; From e805560af7b095ef13cb0a5aa9099e8b34d88019 Mon Sep 17 00:00:00 2001 From: Nam Rodriguez Date: Mon, 16 Nov 2026 17:35:34 -0500 Subject: [PATCH 2/2] CI: say what the runner measured: memory is the tight resource, not disk --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 673c4d538..6c8aeb3ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,10 +96,10 @@ jobs: # Five times since 13 November the runner stopped answering during the # first cargo step and GitHub failed the job after 55 minutes as "lost # communication": no test log, and every rerun passed. That step built - # the whole workspace with full debug info: about 19 GB of target and - # close to 14 GB of compiler memory at four jobs, on a runner with 16 GB - # and a few tens of GB of free disk. Line tables keep file:line in panics - # and backtraces at about a third of the disk and build time. + # the whole workspace with full debug info at four jobs, on a runner with + # 16 GB of memory (disk is not short: 87 GB free). With line tables the + # build peaks near 11 GB (the build step logs it each minute), builds in + # about a third of the time, and panics and backtraces keep file:line. env: CARGO_PROFILE_DEV_DEBUG: line-tables-only defaults: