Skip to content

Fix flaky CI tests in miniflare browser and workflow fixtures - #13607

Merged
petebacondarwin merged 2 commits into
mainfrom
fix/ci-flaky-tests-browser-and-workflows
Apr 20, 2026
Merged

Fix flaky CI tests in miniflare browser and workflow fixtures#13607
petebacondarwin merged 2 commits into
mainfrom
fix/ci-flaky-tests-browser-and-workflows

Conversation

@petebacondarwin

@petebacondarwin petebacondarwin commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes three pre-existing flaky CI test failures:

  • miniflare browser test (test/plugins/browser/index.spec.ts): The /json/list vs /json alias comparison fails because the page title for about:blank changes between sequential requests (from "" to "about:blank"). Fix: strip the volatile title field before comparing.
  • workflow unit tests (fixtures/vitest-pool-workers-examples/workflows/test/unit.test.ts): All 6 tests shared INSTANCE_ID = "12345678910", causing Durable Object state leakage between tests when unsafeAbort/deleteAll() hadn't fully completed before the next test started. Fix: use crypto.randomUUID() per test.
  • vitest-pool-workers dispose ordering (src/worker/workflows.ts): WorkflowIntrospectorHandle.dispose() restored the original env binding after awaiting all async instance aborts, leaving a window where the next test could see a stale proxy. Fix: restore the binding synchronously first, then await cleanup.

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: test-only and internal library fix

Open in Devin Review

- miniflare browser test: strip volatile page title before comparing
  /json/list and /json alias endpoints (title changes between requests)
- workflow unit tests: use unique instance IDs per test via
  crypto.randomUUID() to avoid Durable Object state leakage
- vitest-pool-workers: restore env binding before async instance
  cleanup in dispose() to prevent proxy leakage between tests
@petebacondarwin petebacondarwin added ci:no-changeset-required Skip pull request checks for a valid changeset ci-flake Applied to PRs addressing CI flakiness labels Apr 20, 2026
@changeset-bot

changeset-bot Bot commented Apr 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 691d80f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Apr 20, 2026
@workers-devprod
workers-devprod requested review from a team and penalosa and removed request for a team April 20, 2026 12:13
@workers-devprod

workers-devprod commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@ask-bonk

ask-bonk Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

UnknownError: ProviderInitError

github run

@ask-bonk

ask-bonk Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

@petebacondarwin Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@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

@pkg-pr-new

pkg-pr-new Bot commented Apr 20, 2026

Copy link
Copy Markdown
create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 691d80f

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me 🙂

Although, shouldn't a changeset be added for the vitest-pool-workers change?

@workers-devprod workers-devprod 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.

Codeowners reviews satisfied

@petebacondarwin

petebacondarwin commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

Looks good to me 🙂

Although, shouldn't a changeset be added for the vitest-pool-workers change?

Yes I think you are right! I'll add one.
I think original the idea was that this has no real user facing change, only for tests under load.
But perhaps it might effect users so ...

@petebacondarwin petebacondarwin removed the ci:no-changeset-required Skip pull request checks for a valid changeset label Apr 20, 2026
@petebacondarwin
petebacondarwin merged commit d5d0446 into main Apr 20, 2026
49 of 50 checks passed
@petebacondarwin
petebacondarwin deleted the fix/ci-flaky-tests-browser-and-workflows branch April 20, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-flake Applied to PRs addressing CI flakiness

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants