Cap every test's timeout at 60 s #8933
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.48) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 556 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.378
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8933"
general
weight: 0.35
jasnell
Caps every test's Bazel timeout at 60 s, and speeds up the tests that went over it or came close.
Every test should finish within 40 s in every CI config, sanitizers included, so a test that reaches 60 s has hung or regressed. Today CI waits up to 240 s for an enormous test, up to 2,400 s under TSan and 240 s under coverage before it reports one.
Timeouts (small, medium, large, enormous)
| Config | Before | After |
| --- | --- | --- |
| Default (also ASan and Windows) | 3, 15, 60, 240 | 3, 15, 60, 60 |
| TSan | 30, 150, 600, 2400 | 30, 60, 60, 60 |
| macOS cross-compile to x86_64 | 1, 30, 60, 240 | 1, 30, 60, 60 |
| Coverage | 240 for every size | 60 for every size |
| PGO training (
pgo-instrument) | 30, 240, 600, 1200 | unchanged |PGO training keeps its longer timeouts: it collects profiles rather than checking changes, its serving workload takes about a minute, and a test that times out loses its profile. Tests with
timeout = "eternal"now get 60 s too; cron-test, the one that runs in CI, takes about 25 s.Tests made faster here
| Test | Before (TSan unless noted) | After (TSan unless noted, bazelflare) |
| --- | --- | --- |
|
repl-test: 4 shards, every fourth case each | 52-74 s | max 17 s (20 runs) ||
wpt:WebCryptoAPI: 8 → 16 shards | shards ~20 s, 40-60 s on slow executors, once 104 s | p50 10 s, max 26 s (5 runs × 16 shards) ||
wpt:encoding,wpt:encoding-ts: 4 shards each | ~25 s, 50-82 s on slow executors | max 12 s (5 runs) ||
container-client(all 3 variants): 8 shards, every eighth case each | 92-155 s, default config (test-linux) | max 30.5 s, default config (5 runs × 8 shards) ||
scheduler-test(all 3 variants):sequentialAbortfills the timeout quota first | 58-159 s | max 4.8 s (5 runs) |All of them also pass in the default config; the WPT suites and
repl-testin ASan too.workerd testcan't divide a config's entrypoints between Bazel shards, socontainer-client's test module wraps its own cases: a shard runs everyTEST_TOTAL_SHARDS-th case in name order and the rest pass at once. The shard variables reach the worker throughfromEnvironmentbindings, which arenulloutside Bazel, so a plain run still runs every case.sequentialAbortchecked that aborting ascheduler.waitfrees its slot in the 10,000-timeout quota by aborting 11,000 waits. Each abort throws an exception, about 5 ms under TSan against 0.2 ms in a fastbuild, and most of that looks like KJ capturing the exception's stack trace (any KJ exception costs about the same; switching KJ to_Unwind_Backtraceraises it to 12 ms). The test now fills all but one slot with waits that never end, checks the quota is full, and waits and aborts 100 times in the last slot. With the cleanup inScheduler::wait()removed, it fails on the second wait.How I measured
Per-test process wall time from the Bazel profiles of the
Testsworkflow, over the 6 runs onmainand 33 pull request runs since #8853-#8863 landed (2026-11-25 21:00 UTC onward), leaving out 3 pull request runs that tested an older base. The linux-arm jobs' profiles carry almost no per-test times, so their numbers come from the progress lines of 44 job logs each, which also count time spent waiting for a local CPU and so overstate. Coverage keeps no per-test timings in CI and its results onmainare cache hits, so I ran the coverage job's targets once, uncached, on bazelflare.Expected state of CI
No test I know of goes over the cap now. These came close, but stayed under it in a normal run:
server-testshard took 43-61 s (already a large test, with the same 60 s as before).cron-testp50 25 s, max 50 s.d1-test,workflows-test,sql-testandkv-testeach reached 43-47 s once.server-test@all-autogatesshard took 56-184 s, one ASan run withserver-testshards at 42-54 s, and pyodide vendor tests at 40-62 s under TSan.server-test@all-autogatesshards up to about 41 s (log progress, an overestimate).🤖 Generated with Claude Code