Fix flaky CI tests in miniflare browser and workflow fixtures - #13607
Conversation
- 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
🦋 Changeset detectedLatest 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
UnknownError: ProviderInitError |
|
@petebacondarwin Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
dario-piotrowicz
left a comment
There was a problem hiding this comment.
Looks good to me 🙂
Although, shouldn't a changeset be added for the vitest-pool-workers change?
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Yes I think you are right! I'll add one. |
Summary
Fixes three pre-existing flaky CI test failures:
test/plugins/browser/index.spec.ts): The/json/listvs/jsonalias comparison fails because the pagetitleforabout:blankchanges between sequential requests (from""to"about:blank"). Fix: strip the volatiletitlefield before comparing.fixtures/vitest-pool-workers-examples/workflows/test/unit.test.ts): All 6 tests sharedINSTANCE_ID = "12345678910", causing Durable Object state leakage between tests whenunsafeAbort/deleteAll()hadn't fully completed before the next test started. Fix: usecrypto.randomUUID()per test.src/worker/workflows.ts):WorkflowIntrospectorHandle.dispose()restored the originalenvbinding 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.