Repository navigation
Conversation
src/workerd/server/tests holds tests of workerd-only features: the server's own code, its config extensions, the inspector, async traces, containers and the like. Five tests there test runtime code under src/workerd/api and src/workerd/io instead, and downstream builds of the runtime can't tell them apart from the server's tests by path. Move them under src/workerd/api/tests: - weakref: WeakRef and FinalizationRegistry across requests, now a wd-test (weakref-test.wd-test) instead of a Node driver around a workerd process. Each case calls its own target worker through a service binding, so every call is a new request into that target. The target keeps a strong reference to the WeakRef's object until the gc request 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: the workerd:unsafe APIs The UDP tests stay: a worker can't send UDP, so they drive the server's UDP listener from Node, which makes them tests of the server. Also bring the list of src/workerd/server/tests subdirectories in src/workerd/server/AGENTS.md up to date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Python Workers tests exercise the Pyodide runtime in src/pyodide and src/workerd/api/pyodide, not workerd's server code, so they now sit next to the runtime instead of under src/workerd/server/tests. The vendored-package tests generate embed paths that climb from the generated config to the external repositories. The number of `../` was a constant tied to the old package's depth, plus a `level` argument for subpackages. vendored_py_wd_test now derives it from the package path, so the tests don't depend on where they live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danlapid
force-pushed
the
dlapid/rehome-server-tests
branch
from
November 18, 2026 01:38
2209beb to
0076965
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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 flightwrapped-binding-serialization: RPC serialization of wrapped bindingsunsafe-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.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