Speed up the Python tests in debug and sanitizer builds #8860
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 386 lines diff across 4 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.356
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8860"
general
weight: 0.35
hoodmane
The Python tests are among the slowest in the debug and sanitizer builds. Each commit fixes one cause:
--liftoff-only, a workerd run in debug and TSan builds uses 1.3 to 2.5 times less CPU, and its wall time on an idle machine stays about the same. The JSPI and stack-switching tests keep V8's default tiering.workerd test's filter, so they run in parallel, and the test reads the Pyodide bundles from the disk cache thatpy_wd_testuses rather than downloading them, so it no longer needs network access.top-level-entropy-create-baselinetarget (create_baseline_snapshotinpy_wd_test) starts Pyodide from scratch, creates a baseline snapshot and restores it, in every version.The table compares typical (median) times before this change with the average and worst of 5 runs after it. The "after" runs covered every Python test and variant at once, about 800 runs sharing the executors:
| | TSan before | TSan after (avg / worst) | debug before | debug after (avg / worst) |
|---|---|---|---|---|
| asgi (each version) | 54–60 s | 8–15 s / 23 s | 51–56 s | 8–21 s / 37 s |
| worker-loader-python-test | 33–36 s | 12–20 s / 43 s per case | 33–34 s | 14–20 s / 58 s per case |
| durable-object-websocket | 20–23 s | 8–11 s / 16 s | 20–21 s | 13–17 s / 29 s |
| slowest Python test | | 22 s / 33 s | | 28 s / 52 s |
Loading the baseline snapshot halved the 0.26.0a2 variants, measured in a separate 5-run pass: debug average 19.9 s → 10.0 s, worst run 26.9 s → 15.9 s; TSan average 14.7 s → 9.2 s.
top-level-entropy-create-baselineaverages 20–26 s per version in debug builds and 15–27 s in TSan over 5 runs; the worker-loader-python-test figures come from the same, more heavily loaded pass, in which evenhello_0.28.2(about 7 s on an idle executor) had runs of over 30 s.🤖 Generated with Claude Code