From 84f7e82275872bee67e0ec88dd69efe7cb7f09e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 07:58:43 +0000 Subject: [PATCH 1/2] test(pds): give the conformance run 180s 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 Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB --- packages/pds/test/conformance.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/pds/test/conformance.test.ts b/packages/pds/test/conformance.test.ts index a14ce7e4..73a580a1 100644 --- a/packages/pds/test/conformance.test.ts +++ b/packages/pds/test/conformance.test.ts @@ -25,8 +25,10 @@ describe("conformance suite vs the integrated PDS", () => { it( "passes the operator-tier and discovery checks, blobs included", { - // The catalogue runs ~10s alone; leave room for a loaded machine. - timeout: 60_000, + // ~10s alone, but ~25s after the rest of the suite has run in the + // same isolate (isolate: false), and CI is ~2.5x slower again: + // 60s was routinely hit (58.7s on #257). Matches the spaces runner. + timeout: 180_000, }, async () => { const fetchAdapter: typeof fetch = (input, init) => From 2ae1d961bee8c2909043b17c9af044cc3e680004 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 08:18:29 +0000 Subject: [PATCH 2/2] test(pds): call the worker directly instead of through the loopback 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 Claude-Session: https://claude.ai/code/session_01LZ7qcQNQoiA6a23woGC7tB --- packages/pds/test/conformance.test.ts | 7 +++---- packages/pds/test/helpers.ts | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/packages/pds/test/conformance.test.ts b/packages/pds/test/conformance.test.ts index 73a580a1..61d3a26e 100644 --- a/packages/pds/test/conformance.test.ts +++ b/packages/pds/test/conformance.test.ts @@ -25,10 +25,9 @@ describe("conformance suite vs the integrated PDS", () => { it( "passes the operator-tier and discovery checks, blobs included", { - // ~10s alone, but ~25s after the rest of the suite has run in the - // same isolate (isolate: false), and CI is ~2.5x slower again: - // 60s was routinely hit (58.7s on #257). Matches the spaces runner. - timeout: 180_000, + // ~3s; the catalogue makes ~1000 requests, so allow for a slow + // machine. + timeout: 60_000, }, async () => { const fetchAdapter: typeof fetch = (input, init) => diff --git a/packages/pds/test/helpers.ts b/packages/pds/test/helpers.ts index 925b1fce..1dbb8d62 100644 --- a/packages/pds/test/helpers.ts +++ b/packages/pds/test/helpers.ts @@ -1,16 +1,24 @@ /** * Test helpers with properly typed env */ -import { env as _env, exports } from "cloudflare:workers"; +import { env as _env } from "cloudflare:workers"; +import { createExecutionContext } from "cloudflare:test"; export { runInDurableObject } from "cloudflare:test"; +import app from "../src/index"; import type { PDSEnv } from "../src/types"; // Re-export env with correct type for tests export const env = _env as PDSEnv; -// Worker fetch using exports.default -export const worker = ( - exports as { - default: { fetch: (request: Request, env: PDSEnv) => Promise }; - } -).default; +/** + * The worker under test, called directly with a fresh ExecutionContext per + * request. Not through the `exports.default` loopback: every loopback call + * left the next one slower (1000 requests took a trivial 404 from ~1ms to + * ~190ms), which made the suite quadratic and timed out the conformance + * run in CI. waitUntil work is left running, as in production. + */ +export const worker = { + fetch(request: Request, env: PDSEnv): Promise { + return Promise.resolve(app.fetch(request, env, createExecutionContext())); + }, +};