test: deflake watch cwd with isolation none

Windows directory watchers report last-access time updates. Reading cold
fixtures in the child can therefore trigger test:watch:restarted before
it exits, failing the mustNotCall assertion without printing the error.

Read the fixtures before starting watch mode and remove the Windows
flaky expectation. With old access times and a delayed child exit, the
original fails 10/10 runs and the change passes 100/100 on Windows.

Also remove the argv variant's stale flaky expectation. It passes
repeated local Windows runs and the inspected CI history after #66035.

Refs: https://github.com/nodejs/node/issues/66056
Refs: https://github.com/nodejs/node/pull/66035
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66320
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Filip Skokan authored and Node.js GitHub Bot committed 2026-09-30 08:25:52 +00:00
1 parent 90c1ff7774
commit e8789317f2
2 files changed
+7 -6

No files matched your search

@@ -1,14 +1,20 @@
// Test run({ watch: true, cwd, isolation: 'none' }) runs with different cwd while in watch mode and isolation none
import * as common from '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import { readdir, readFile } from 'node:fs/promises';
import { run } from 'node:test';
import { skipIfNoWatch } from '../common/watch.js';
skipIfNoWatch();
// Read the fixtures before watching them. On Windows, their first read can
// update access times and trigger a restart without changing their contents.
const cwd = fixtures.path('test-runner-watch');
await Promise.all((await readdir(cwd)).map((file) => readFile(fixtures.path('test-runner-watch', file))));
const controller = new AbortController();
const stream = run({
cwd: fixtures.path('test-runner-watch'),
cwd,
watch: true,
signal: controller.signal,
isolation: 'none',
-5
View File
@@ -5,8 +5,3 @@ prefix test-runner
# sample-test : PASS,FLAKY
[true] # This section applies to all platforms
[$system==win32]
# https://github.com/nodejs/node/issues/66056
test-run-watch-cwd-isolation-none: PASS, FLAKY
test-run-watch-cwd-isolation-none-argv: PASS, FLAKY