Skip to content

[Tests] Cover the Cloudflare tunnel timeout with no reported error - #8733

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
tests-maintenance-36946068883
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
tests-maintenance-36946068883

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

The seven-day review of Main tests (2026-09-25 to 2026-10-02 UTC) found ten failed runs. Every evidenced flake in that window is already claimed, so this PR closes a coverage gap instead:

The remaining failures in the window were cancellations rather than test failures.

The Cloudflare tunnel timeout handler has two branches: report the last collected cloudflared errors, or fall back to Could not start Cloudflare tunnel: unknown error. when none were collected. Only the first branch was exercised. I confirmed the gap by changing the fallback message in tunnel.ts and running the package suite — all 19 tests still passed, so that user-facing message could change or break silently.

WHAT is this pull request doing?

Adds one test to packages/plugin-cloudflare/src/tunnel.test.ts that writes a cloudflared log line matching neither the URL, connection, nor known-error patterns, then advances the fake clock past the unit-test tunnel timeout and asserts the fallback status.

No production code changes. The test follows the fake-timer pattern of the neighbouring cleans errors coming from the log case, including its try/finally restore, and asserts the public getTunnelStatus() contract rather than internal wiring.

The test is load-bearing: with the fallback message mutated it fails and no other test does; restored, it passes.

Validation on Linux / Node 26.1.0: the file and the full plugin-cloudflare suite pass (19 tests), five consecutive --sequence.shuffle runs pass, and --pool=forks and --no-file-parallelism pass. lint and type-check are clean. The branch under test is platform-independent and uses fake timers, so it carries no OS-specific timing risk; Windows and macOS confirmation comes from CI.

How to manually test your changes?

CI

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

The tunnel timeout handler has two branches: it reports the last collected
cloudflared errors, or falls back to "unknown error." when none were
collected. Only the first branch was exercised, so the fallback message
could change or break without any test noticing.

Add a case that writes a log line matching neither the URL, connection, nor
known-error patterns, then advances the fake clock past the unit-test
tunnel timeout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

0 participants