Repository navigation
Conversation
Some tests call admin routes that start background work against bsky.network, the Jetstream firehose and plc.directory. While the worker waits for one of those host names to resolve, the other tests in the isolate wait with it, so a slow DNS lookup in CI made unrelated tests such as "accepts uppercase BEARER scheme" hit the 5 s limit. Answer every outbound request from the test worker with a 503 stub instead. Production config is unchanged.
|
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://daniel-aggregator-tests-offline.try.emdashcms.com, https://daniel-aggregator-tests-offline-emdash-playground.emdash-cms.workers.dev (commit b48e407)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
There was a problem hiding this comment.
The approach is sound. Stubbing outbound requests with a 503 at the Miniflare outboundService layer fixes the DNS-dependent test timeouts at their cause. It is narrowly scoped to apps/aggregator/vitest.config.ts, leaves production behavior and the tests unchanged, and needs no changeset because the package is private. Both reviewers approved with no findings. One caveat from the first reviewer: @cloudflare/vitest-plugin was not installed in the checkout, so it could not confirm the plugin passes outboundService through to Miniflare. The PR's per-host request counts suggest it does. The second reviewer's review was static only, with no tests, builds or lint run.
Reviewed by anthropic/claude-opus-5-5 and openai/gpt-6.1-sol.
What does this PR do?
Stops "accepts uppercase BEARER scheme" and a few tests around it from timing out in the aggregator suite, on
maintoo. Some tests call admin routes that start real work in the background: discovery onbsky.network, a Jetstream connection, and DID lookups onplc.directory. While the test worker waits for one of those host names to resolve, the other tests wait with it, so a slow DNS lookup in CI pushes whichever test is running past the 5 s limit.The test config now answers every outbound request from the worker with a 503 stub, so no test waits on DNS or on a live service. Production config and the tests themselves are unchanged.
Type of change
Your connection to this change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain. (n/a: test config only)@emdash-cms/aggregatorapp)AI assistance disclosure
Screenshots / test output
mainrun on bed3e42 took 3,362 ms for "accepts an empty body and triggers discovery", 3,939 ms for "accepts canonical mixed-case Bearer" and 8,064 ms for "accepts uppercase BEARER scheme", which timed out. Relay discovery never finished in that run.main, 10 of the 50 tests inbackfill.test.tstime out, among them "accepts uppercase BEARER scheme" and "returns 400 on a non-arraydidsvalue", whose request never leaves the worker. With this change, all 50 pass in 2 s.main. A server that never answers, or an address that never connects, leaves all 50 passing, so it is the name lookup that holds the tests up.bsky.network, 1 for Jetstream and 8 forplc.directory, which are all the hosts the worker reaches.