Skip to content

Commit bdb561f

Browse files
test: revert the watch re-touch changes
Rewriting unseen files and retrying longer did not help on macOS: the watcher still missed the changes, so the harness goes back to main's version.
1 parent b21bbac commit bdb561f

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

‎test/templates/WatchTestCases.js‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const testRootDirectory = path.join(__dirname, "..");
3636
const STEP_DELAY = 200;
3737
const AGGREGATE_TIMEOUT = 50;
3838
const RETOUCH_DELAY = 1000;
39-
const RETOUCH_LIMIT = 5;
39+
const RETOUCH_LIMIT = 3;
4040

4141
/**
4242
* @param {string} src src
@@ -381,17 +381,10 @@ const describeCases = (config) => {
381381
)
382382
);
383383
}
384-
// macOS can drop a change event entirely, and a timestamp-only
385-
// touch can go unseen too for a re-created file, so rewrite it
384+
// macOS can drop a change event entirely
386385
const now = new Date();
387386
for (const file of unseenChanges) {
388-
if (!fs.existsSync(file)) continue;
389-
// a directory stands for a file created in a missing one
390-
if (fs.statSync(file).isDirectory()) {
391-
fs.utimesSync(file, now, now);
392-
} else {
393-
fs.writeFileSync(file, fs.readFileSync(file));
394-
}
387+
if (fs.existsSync(file)) fs.utimesSync(file, now, now);
395388
}
396389
retouchUnseenChanges(compilers, retries - 1);
397390
}, RETOUCH_DELAY);

0 commit comments

Comments
 (0)