Skip to content

Give Cloudflare test polls a 10 s limit - #60

Merged
cardmagic merged 2 commits into
mainfrom
fix/cloudflare-poll-timeout
Oct 2, 2026
Merged

cardmagic merged 2 commits into
mainfrom
fix/cloudflare-poll-timeout

Conversation

@cardmagic

@cardmagic cardmagic commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

delivers the complete failure envelope for 'retry' in test/cloudflare/effect-payloads.test.ts failed in CI run 36884020000, attempt 1 (PR #59, head 295b908). The poll failed with Matcher did not succeed in time after the received list stayed []. Attempt 2 of the same run passed, and the push run on the same commit passed.

Cause: the Cloudflare tests wait for durable work with expect.poll. Of the 24 polls in test/cloudflare, 23 used the Vitest default limit of 1 s. The retry case needs five alarm-driven delivery attempts and a callback turn. In the failed attempt, every Cloudflare test file ran 5 to 12 times slower than usual, so that chain took more than 1 s:

File Usual CI time Failed attempt
realtime ~0.75 s 5.3 s
runtime ~0.65 s 5.8 s
recovery ~1.6 s 8.6 s
contract ~0.24 s 4.1 s
effect-payloads ~1.4 s 7.9 s

The engine is not at fault. The same file also ran slowly before this change, for example 4.3 s on main (8d8140e) and 10.0 s on feat/result-lookup (2c9dd13).

Fix: set expect.poll.timeout to 10 s for the whole Cloudflare suite in vitest.cloudflare.config.ts. A poll still returns as soon as its condition holds, so a normal run does not take longer. The 15 s test timeout and the explicit 15 s poll in recovery.test.ts do not change.

Undici audit fix

The first CI run of this PR failed at pnpm audit --audit-level=high, not at a test. Two high Undici advisories (WebSocket subprotocol denial of service, TLS certificate validation bypass) now affect undici >=7.0.0 <7.29.1, which reaches this repository only through Miniflare. main last ran CI on September 23, before the advisories, so main fails this audit too.

48aec85 overrides [email protected] with 7.29.1 in pnpm-workspace.yaml and the lockfile. This is the same change as e128a95 on feat/portable-observability (#59). #59 also records it in the changelog, so this PR does not; a second entry would conflict when #59 merges.

Compatibility

Test configuration and a development-tooling dependency override only. No runtime, API, or published package effect. Not applicable to the Ruby gem, which has no Cloudflare backend.

Validation

  • Reproduction: a temporary 250 ms delay in each 'retry' delivery attempt in test/cloudflare/worker.ts copies a slow runner. With the default limit, the test fails with Matcher did not succeed in time after 1052 ms. With the 10 s limit, it passes in 1365 ms. Both results are on main and on PR Align observability and runtime contracts #59's head.
  • A lost callback still fails clearly: with a 12 s delay per attempt, the test fails with Matcher did not succeed in time after 10037 ms, before the 15 s test timeout.
  • pnpm run test:cloudflare: 58 passed on main; 59 passed three times on PR Align observability and runtime contracts #59's head.
  • pnpm run check and prettier --check pass.
  • Audit: without the override, pnpm audit --audit-level=high exits 1 with the same two high Undici advisories as CI. With the override, it reports no high vulnerabilities.
  • With the override: pnpm install --frozen-lockfile, format:check, check, build, test:cloudflare (59 passed), check:cloudflare, and pnpm test (528 passed, 32 skipped) pass.

The Cloudflare tests wait for durable work with expect.poll, and 23 of
its 24 calls used the Vitest default limit of 1 s. The retry failure
envelope needs five alarm-driven delivery attempts and a callback turn.
In CI run 36884020000, attempt 1, every Cloudflare test file ran 5 to
12 times slower than usual, and that chain took more than 1 s.

Set a 10 s poll limit for the whole Cloudflare suite. A poll still
returns as soon as its condition holds, and a lost callback still fails
with the poll error before the 15 s test timeout.
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Adjusts test timeout settings for Cloudflare tests.

The PR appears safe to merge.

Summary

Extends the default expect.poll timeout for Cloudflare tests from 1 s to 10 s while retaining the 15 s test timeout and explicit per-poll overrides.

Reviews (1) · Last reviewed commit: "test: give Cloudflare polls a 10 s limit"

pnpm audit --audit-level=high fails on main since two high Undici
advisories were published: a WebSocket subprotocol denial of service
and a TLS certificate validation bypass. Both reach this repository
only through Miniflare in the Cloudflare development tooling.

Override Undici 7.29.0 with the patched 7.29.1 release, the same
change as e128a95 on feat/portable-observability. That branch also
records the patch in the changelog, so this commit does not.
@cardmagic
cardmagic merged commit 1338e20 into main Oct 2, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant