Skip to content

test(platform): skip real sleeps in teardown and GitHub retry tests - #447

Merged
Brooooooklyn merged 1 commit into
mainfrom
test/skip-real-sleeps
Oct 16, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
test/skip-real-sleeps

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Problem

Some platform tests sleep for real on delays that the code under test owns:

test                                       real wait                       source
teardown (zero-trust, email, managed DO)   2 s orphan-sweep pause (×4)     provisioning/cleanup.ts
GitHub check-run / token / webhook retries 250 ms backoff (×15)            check-run.ts, installation-token.ts, webhook-deliveries.ts

A probe that wrapped setTimeout during a full platform run found these waits. They add about 13 s of test time and check nothing.

What this PR changes

  • The three teardown tests call the existing skipOrphanSweepDelay() helper. Six files already use it. It zeroes only the 2 s delay. The cfFetch 60 s abort timer keeps its real delay, so it cannot fire early.
  • The GitHub unit tests zero only the 250 ms backoff, in their existing beforeEach hooks. Each file's afterEach already restores the spy.
  • api-check-runs.test.ts is not changed: BuildManager has its own guard timers.

Every test still checks the same attempt counts and outcomes.

File Before After
unit/check-run.test.ts 1.66 s 0.12 s
unit/installation-token.test.ts 1.90 s 0.13 s
unit/webhook-deliveries.test.ts 0.64 s 0.12 s
integration/zero-trust-uninstall.test.ts 6.08 s 1.10 s
integration/email-shared-recipients.test.ts 4.24 s 1.89 s
integration/managed-durable-objects.test.ts 5.19 s 2.62 s

Testing

Check Result
Changed files same pass counts before and after
vp run test 86 passed, 2 skipped (need a real Postgres URL)
vp run check 33/33

🤖 Generated with Claude Code

Four teardown tests waited for the 2-second orphan-sweep pause, and the
GitHub check-run, installation-token and webhook-delivery tests waited on
250 ms retry backoffs. They now skip only those delays and still check the
same behavior. The six files take about 6 s instead of about 20 s.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

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-16T05:14:36.243055Z 6da3c29 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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://test-skip-real-sleeps-void-cloud.voidzero-docs.workers.dev (commit 6da3c29)

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://01d7f021-void-cloud.voidzero-docs.workers.dev 6da3c29 2026-10-16T05:14:01.340Z Visit the dashboard ↗

@Brooooooklyn
Brooooooklyn merged commit 738d1d8 into main Oct 16, 2026
20 checks passed
@Brooooooklyn
Brooooooklyn deleted the test/skip-real-sleeps branch October 16, 2026 05:31
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