Move runtime and Python tests out of src/workerd/server/tests #8567
All Vouch review confidence checks passed
Residual risk 0.18 = 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 · 362 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.353
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8567"
general
weight: 0.35
ryanking13
src/workerd/server/testsis meant for tests of workerd-only features: the server's own code, config extensions, the inspector, async traces, containers and the like. Some tests of runtime code that downstream builds also ship ended up there too. That makes the path a poor guide to what a test covers.This moves them next to the code they test, in two commits:
1. Runtime tests to
src/workerd/api/tests:-
weakref:WeakRefandFinalizationRegistryacross requests. This was a Node driver around aworkerd serveprocess and is now a plain wd-test (weakref-test.wd-test). Each case calls its own target worker through a service binding, so every call is a new request into that target. The target now holds a strong reference to the WeakRef's object until thegcrequest drops it. V8 may collect a WeakRef's target at any GC once the job that created it ends, and the driver version passed only because no GC ran between its requests.-
socket-close: closing a socket with a pipe close in flight-
wrapped-binding-serialization: RPC serialization of wrapped bindings-
unsafe-eval,unsafe-module: theworkerd:unsafeAPIsNothing under
src/workerd/apiusesserver-harness.mjs. The UDP tests (udp-connect,udp-connect-ts-streams,udp-datagram-drop) stay insrc/workerd/server/tests: a worker has no API for sending UDP, so they send datagrams from Node to the server's UDP listener, which makes them tests of the server. The commit also brings the subdirectory list insrc/workerd/server/AGENTS.mdup to date.2. The Python Workers tests to
src/pyodide/tests, next to the Pyodide runtime they exercise. The vendored-package tests generated embed paths with a../count that was a constant tied to the old directory's depth, plus alevelargument for subpackages.vendored_py_wd_testnow derives the count from the package path, andlevelis gone. The 7src/cloudflare/internal/testpackages that loadpy_wd_test.bzl, and the PyodideAGENTS.md, point at the new path.Apart from the weakref rewrite, no test changes what it does, and target names are unchanged under the new packages.
Testing
On bazelflare:
weakref-testpasses in all variants, including@gc-stress.server-harness-testpass.//src/pyodide/...and//src/cloudflare/internal/test/...pass: 302 targets, including every Python variant, the vendored-package tests and the ESLint checks.bazel build --nobuild //...analyzes the whole repo without errors.tools/cross/format.py --checkis clean.Edgeworker's docs mention the old Python path in two places (
docs/python_workers.mdand a comment insrc/edgeworker/tests/python/snapshots/BUILD). Nothing there loads from it, so this doesn't break its build.🤖 Generated with Claude Code