Skip to content

[wrangler] Make worker deletion in e2e test cleanup best-effort - #12832

Merged
penalosa merged 2 commits into
mainfrom
best-effort-worker-deletion-e2e
Mar 10, 2026
Merged

penalosa merged 2 commits into
mainfrom
best-effort-worker-deletion-e2e

Conversation

@petebacondarwin

@petebacondarwin petebacondarwin commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

Worker deletion in afterEach/afterAll hooks can hang when the Cloudflare backend flakes or responds slowly. Since helper.run() uses spawnSync with a 50-second default timeout, a single stalled cleanup can block for up to 50 seconds — and multiple sequential cleanups compound to minutes. This causes test hook timeouts that mask real test failures.

Changes:

  • Add a bestEffortRun() method to WranglerE2ETestHelper that passes a 5-second timeout to spawnSync and swallows errors (logging a warning instead of throwing)
  • Use bestEffortRun() for all wrangler delete calls in cleanup hooks across deploy.test.ts, deployments.test.ts, provision.test.ts, and the worker() helper method

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: this only changes test cleanup behavior (best-effort resource deletion)
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal test infrastructure change only

Open with Devin

@petebacondarwin petebacondarwin added the ci:no-changeset-required Skip pull request checks for a valid changeset label Mar 10, 2026
@changeset-bot

changeset-bot Bot commented Mar 10, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4085e7b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Mar 10, 2026 •

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12832

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12832

miniflare

npm i https://pkg.pr.new/miniflare@12832

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12832

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12832

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12832

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12832

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12832

wrangler

npm i https://pkg.pr.new/wrangler@12832

commit: 8f8aed9

@petebacondarwin
petebacondarwin marked this pull request as ready for review March 10, 2026 16:14
@petebacondarwin
petebacondarwin requested a review from a team as a code owner March 10, 2026 16:14
@workers-devprod

workers-devprod commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Mar 10, 2026
Worker deletion in afterEach/afterAll hooks can hang when the backend
flakes or responds slowly, causing test hook timeouts that mask real
test failures.

Add a bestEffortRun() helper that uses a short timeout (5s) and
swallows errors, then use it for all wrangler delete calls in cleanup
hooks so the test suite moves on quickly instead of stalling.
@petebacondarwin
petebacondarwin force-pushed the best-effort-worker-deletion-e2e branch from af8be84 to 4085e7b Compare March 10, 2026 17:07
@penalosa
penalosa merged commit ba18c02 into main Mar 10, 2026
34 checks passed
@penalosa
penalosa deleted the best-effort-worker-deletion-e2e branch March 10, 2026 17:50
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Mar 10, 2026
@petebacondarwin petebacondarwin added the ci-flake Applied to PRs addressing CI flakiness label Apr 9, 2026
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:no-changeset-required Skip pull request checks for a valid changeset ci-flake Applied to PRs addressing CI flakiness

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants