Skip to content

Run the email clipboard watch test on fake timers - #387

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/email-cli-domain-flake
Oct 8, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/email-cli-domain-flake

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Problem

The clipboard watch test in email-cli-domain.test.ts sometimes fails when the machine is busy.

watch window: Date.now() + 40 ms
read 1 ──► 'ghp_ignored'  (not a Cloudflare token)
   … event loop stalls under load past 40 ms …
deadline passed ──► falls back to the paste prompt
test sees the paste token, not the clipboard token ✗

Fix

The test runs the watch on fake timers and advances time by the watch window, so the 40 ms deadline cannot pass early. The assertions do not change. afterEach restores real timers.

Testing

Command Result
vp test run packages/void/test/unit/email-cli-domain.test.ts pass (50 tests)
vp lint, vp fmt --check on the file pass

🤖 Generated with Claude Code

The clipboard watch ends at a Date.now() deadline (40 ms in this test).
Under heavy load the event loop can stall long enough for the deadline to
pass before the token poll, so the flow falls back to the paste prompt and
the test sees the paste token instead of the clipboard one. Fake timers
make the window virtual; the assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-email-cli-domain-flake-void-cloud.voidzero-docs.workers.dev (commit 48c3784)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://bb53afc9-void-cloud.voidzero-docs.workers.dev 48c3784 2026-10-08T03:34:08.780Z Visit the dashboard ↗

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T03:34:33.756948Z 48c3784 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Brooooooklyn
Brooooooklyn merged commit c1a404b into main Oct 8, 2026
20 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/email-cli-domain-flake branch October 8, 2026 04:33
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