Skip to content

Avoid leaking filesystem watchers in theme tests#8104

Closed
gonzaloriestra wants to merge 1 commit into
mainfrom
fix/e2e-ci-resource-pressure
Closed

Avoid leaking filesystem watchers in theme tests#8104
gonzaloriestra wants to merge 1 commit into
mainfrom
fix/e2e-ci-resource-pressure

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

The Windows Node 22 unit-test shard in #8051 completed all 2,505 assertions successfully, but Vitest reported six unhandled errors afterward:

EPERM: operation not permitted, watch

Two theme-fs.test.ts tests spied on chokidar.watch while still creating real filesystem watchers. Their temporary directories could be removed while those watchers remained active, causing asynchronous errors on Windows.

WHAT is this pull request doing?

Mocks the Chokidar watcher in both directory-selection tests. The tests continue to verify the paths passed to watch without opening operating-system watchers.

This commit is cherry-picked from #8009 with its original authorship preserved. This draft should be closed if #8009 merges first.

How to test your changes?

  • pnpm --filter @shopify/theme vitest run src/cli/utilities/theme-fs.test.ts
  • pnpm --filter @shopify/theme lint
  • pnpm --filter @shopify/theme type-check
  • git diff --check

Checklist

  • I've considered cross-platform impacts
  • No changeset: test-only fix

Assisted-By: devx/56dcddb4-0bb1-4e96-b794-1bb2fda2cba1
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jul 16, 2026
@gonzaloriestra gonzaloriestra force-pushed the fix/e2e-ci-resource-pressure branch from 12b6639 to f005343 Compare July 16, 2026 09:15
@gonzaloriestra gonzaloriestra changed the title Stabilize E2E and Windows CI under concurrent runs Avoid leaking filesystem watchers in theme tests Jul 16, 2026
@gonzaloriestra gonzaloriestra deleted the fix/e2e-ci-resource-pressure branch July 16, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants