Repository navigation
test(pds): call the worker directly instead of the loopback; fix(spaces): attestation fetches on workerd - #258
Merged
Merged
Conversation
It takes ~10s alone but ~25s after the rest of the suite in the shared isolate, and CI is slower again: it passed in 58.7s against the 60s limit on #257 and timed out on the release PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
Every call through exports.default.fetch left the next one slower: 1000 requests took a trivial 404 from ~1ms to ~190ms, and the slowdown carried across test files. Calling the Hono app directly shows no growth. The suite was quadratic in requests made: the conformance run (~1000 requests) took ~3s alone, ~25s after the other files, and ~60s on CI, where it timed out on the release PR. The helper now calls app.fetch with a fresh ExecutionContext per request, leaving waitUntil work running as in production. All 355 tests pass, and the run's test time drops from ~60s to ~15s locally. The conformance timeout goes back to 60s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
commit: |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
cirrusdocs | 9912642 | Commit Preview URL Branch Preview URL |
Nov 21 2026, 11:58 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
pdscheck | 9912642 | Nov 21 2026, 11:58 AM |
workerd refuses redirect: "error", so on a Worker every client metadata and JWKS fetch threw, every attestation failed and a memberspace with allowedApps refused every app. The unit tests' stub fetch ignored the option, and the conformance checks only cover refusals. Use "manual": a 3xx fails the existing ok check, so redirects are still refused. The stub now rejects "error" as workerd does, and a test pins that behaviour (via the Request constructor, which applies the same check without a rejected promise for the pool to report twice). Calling the PDS directly in tests (previous commit) surfaced this as an unhandled rejection that failed the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB
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.
The PDS conformance test timed out on the release PR (#227). It had passed in 58.7s against a 60s limit on #257. Fixing that exposed a real bug in client attestation, which is fixed here too.
1. Test helper: the loopback made the suite quadratic
test/helpers.tssent every request throughexports.default.fetch, a loopback into the worker's own entrypoint. Each loopback call left every later one slower:exports.default.fetch, trivial 404app.fetchcalled directlyThe cause is in
@cloudflare/vitest-pool-workers@0.16.9. ItscreateProxyPrototypeClasswraps the entrypoint wrapper's shared prototype in a newProxyon every construction, so the traps stack up and every method lookup walks all of them. In Node, a lookup costs 0.7µs after one construction and 17ms after 1000. The fix landed in the renamed@cloudflare/vitest-pluginin 1.2.0, which installs the proxy once; the old package is deprecated and its final release (0.23.0) still has the bug. Moving to@cloudflare/vitest-pluginis left for a separate PR.The conformance run makes about 1000 requests, so it took about 3s alone, about 25s after the other files, and about 60s on CI.
Fix:
worker.fetch(request, env)now calls the Hono app directly, with a freshExecutionContextfor each request.waitUntilwork is left running, as in production. The signature is unchanged and the conformance timeout stays at 60s.2. Attestation fetches used
redirect: "error", which workerd refusesCalling the app directly made the test pool report this as an unhandled rejection, and that failed the first CI run of this PR.
verifyClientAttestationfetched client metadata and JWKS withredirect: "error". workerd refuses that value outright: "won't be implemented … use "manual"". So on a deployed Worker every attestation failed, and a memberspace withallowedAppsrefused every app, attested or not. Nothing caught it:Fix: use
redirect: "manual". A 3xx fails the existingokcheck, so redirects are still refused. The stub now rejects"error"as workerd does, and a test pins workerd's behaviour through theRequestconstructor. With the fix reverted, theallowedAppsattestation test fails. There's a changeset for@getcirrus/spaces(patch).Results
🤖 Generated with Claude Code
https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB