test: fix recursive fs.watch error fixture

Use a child directory so recursive watcher setup always creates a
second watch. Linux no longer watches regular files after the directory
watcher optimization.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/65683
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Filip Skokan authored and Antoine du Hamel committed 2026-09-19 14:29:37 +02:00
1 parent 61ca3ba93c
commit ba65bb149a
1 file changed
+1 -2
+1 -2
View File
@@ -99,8 +99,7 @@ tmpdir.refresh();
let calls = 0;
expected.code = 'ENOSPC';
fs.mkdirSync(directory);
fs.writeFileSync(`${directory}/file`, '');
fs.mkdirSync(`${directory}/subdirectory`, { recursive: true });
fs.watch = common.mustCall(() => {
if (calls++ === 0) {
return { close };