Skip to content

Commit 14eafdf

Browse files
test(native-watcher): revert Windows skip
1 parent c34b27b commit 14eafdf

File tree

4 files changed

+25
-40
lines changed

4 files changed

+25
-40
lines changed

crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,9 @@ async fn this_compilation(
399399

400400
#[plugin_hook(CompilationFinishModules for ConsumeSharedPlugin, stage = 10)]
401401
async fn finish_modules(&self, compilation: &mut Compilation) -> Result<()> {
402-
// Add finishModules hook to copy buildMeta/buildInfo from fallback modules before webpack's export analysis
403-
// This follows webpack's pattern used by FlagDependencyExportsPlugin and InferAsyncModulesPlugin
404-
// We use finishModules with high priority stage to ensure buildMeta is available before other plugins process exports
405-
// Based on webpack's Compilation.js: finishModules (line 2833) runs before seal (line 2920)
402+
// Add finishModules hook to copy buildMeta/buildInfo from fallback modules *after* webpack's export analysis.
403+
// Running earlier caused parity regressions, so we intentionally execute later than plugins like FlagDependencyExportsPlugin,
404+
// matching the behaviour in the universe-local implementation. This still happens before seal (see webpack's Compilation.js).
406405

407406
let (consume_updates, missing_fallbacks) = {
408407
let module_graph = compilation.get_module_graph();

packages/rspack-test-tools/src/case/watch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export function createWatchStepProcessor(
294294
// which will cause the compiler not rebuild when the files change.
295295
// The timeout is set to 400ms for windows OS and 100ms for other OS.
296296
// TODO: This is a workaround, we can remove it when notify support windows better.
297-
const timeout = nativeWatcher && process.platform === "win32" ? 8000 : 100;
297+
const timeout = nativeWatcher && process.platform === "win32" ? 400 : 100;
298298
await new Promise(resolve => setTimeout(resolve, timeout));
299299
copyDiff(path.join(context.getSource(), step), tempDir, false);
300300
await task;

tests/rspack-test/NativeWatcher-webpack.test.js

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,14 @@ function v(name) {
88
return path.join(__dirname, `native_watcher ${name}`);
99
}
1010

11-
if (process.platform === "win32" && process.env.CI) {
12-
describe.skip("NativeWatcher webpack parity (skipped on Windows CI)", () => {
13-
it("skipped due to native watcher instability on Windows CI", () => {});
14-
});
15-
} else {
16-
describeByWalk(
17-
v("(webpack-test)"),
18-
(name, src, dist) => {
19-
createNativeWatcher(name, src, dist, path.join(tempDir, name));
20-
},
21-
{
22-
source: path.resolve(__dirname, "../webpack-test/watchCases"),
23-
dist: path.resolve(
24-
__dirname,
25-
`./js/native-watcher/webpack-test/watch`
26-
)
27-
}
28-
);
29-
}
11+
describeByWalk(
12+
v("(webpack-test)"),
13+
(name, src, dist) => {
14+
createNativeWatcher(name, src, dist, path.join(tempDir, name));
15+
},
16+
{
17+
source: path.resolve(__dirname, "../webpack-test/watchCases"),
18+
dist: path.resolve(__dirname, `./js/native-watcher/webpack-test/watch`)
19+
}
20+
);
21+

tests/rspack-test/NativeWatcher.test.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@ const path = require("path");
22
const { describeByWalk, createNativeWatcher } = require("@rspack/test-tools");
33
const tempDir = path.resolve(__dirname, `./js/temp`);
44

5-
if (process.platform === "win32" && process.env.CI) {
6-
describe.skip("NativeWatcher (skipped on Windows CI)", () => {
7-
it("skipped due to native watcher instability on Windows CI", () => {});
8-
});
9-
} else {
10-
describeByWalk(
11-
__filename,
12-
(name, src, dist) => {
13-
createNativeWatcher(name, src, dist, path.join(tempDir, name));
14-
},
15-
{
16-
source: path.join(__dirname, `./watchCases`),
17-
dist: path.resolve(__dirname, `./js/native-watcher/watch`)
18-
}
19-
);
20-
}
5+
describeByWalk(
6+
__filename,
7+
(name, src, dist) => {
8+
createNativeWatcher(name, src, dist, path.join(tempDir, name));
9+
},
10+
{
11+
source: path.join(__dirname, `./watchCases`),
12+
dist: path.resolve(__dirname, `./js/native-watcher/watch`)
13+
}
14+
);

0 commit comments

Comments
 (0)