Skip to content

test(rstest): run the win32 rename mock test in an isolated pool - #857

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
fix/win32-rename-test-isolation
Sep 25, 2026
Merged

ScriptedAlchemy merged 1 commit into
mainfrom
fix/win32-rename-test-isolation

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Verify (fast) has failed on every Node leg since #844 (runs 36102691096 on 12a1ddc and 36178852750 on b038e1a). rstest-generated-module-win32-rename.test.ts mocks node:fs/promises with rs.mock, but the unit pool runs with isolate: false. When another file in the same worker (for example rstest-generated-module-write.test.ts) loads src/rstest/generated-module.ts first, the cached module keeps the real rename and both tests fail. Local runs passed only because file-to-worker scheduling differed.

This adds a moduleMockTestFiles list to rstest.integration-tests.ts. The unit pool excludes it, and test:host-filesystem (per-file isolation, already run on ubuntu, macOS, and Windows) includes it. The pool-list guard now checks the entry like every other list.

A rs.spyOn on the builtin plus syncBuiltinESMExports was tried and dropped: Rspack's interop binds the builtin at load, so the spy never ran.

Verification

  • Reproduced before the change. rstest --config rstest.unit.config.ts --pool.maxWorkers 1 with the write test then the win32 test failed with the CI assertions.
  • rstest --config rstest.host-filesystem.config.ts <win32 test> passes 2/2. rstest list shows it in that pool and absent from the unit pool.
  • rstest-pool-lists.test.ts passes 34/34.
  • pnpm lint and pnpm typecheck pass.
  • pnpm test: unit 4293/4293, route-unit 91/91, projection 197/197, integration 1162/1165. The 3 integration failures are Playwright timing assertions in Workbench e2e files this change cannot reach (load average 120 to 180 on the host). A targeted rerun passed 2 of the 3 and failed the third on a different 253 ms assertion.
  • Local pnpm test:host-filesystem has 2 dev-host-install.test.ts failures with and without this change. Hosted host-filesystem jobs are green.

@changeset-bot

changeset-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8fa531f

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@ScriptedAlchemy
ScriptedAlchemy merged commit b0dccc5 into main Sep 25, 2026
5 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 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-09-25T20:47:24.756705Z 8fa531f 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.

@ScriptedAlchemy
ScriptedAlchemy deleted the fix/win32-rename-test-isolation branch September 25, 2026 20:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8fa531fefe

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rstest.unit.config.ts
...fixtureProjectTestFiles,
...integrationTestFiles,
...mcpConformanceTestFiles,
...moduleMockTestFiles,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the rename test in the local merge gate

Excluding this file from the unit pool moves it exclusively to test:host-filesystem, but neither the standard check script (package.json:26) nor the local-CI legs (scripts/local-ci.mjs:373-376) invoke that pool. Consequently, the documented local merge gate can pass without exercising this regression at all; retain it in an isolated pool that the local gate runs, while optionally also including it in the cross-OS filesystem job.

AGENTS.md reference: AGENTS.md:L147-L154

Useful? React with 👍 / 👎.

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