From 25f4b9eac11e25ffe9eedb1d2390fa0b04c97d14 Mon Sep 17 00:00:00 2001 From: NuklearRabbit <145918611+NuklearRabbit@users.noreply.github.com> Date: Thu, 27 Aug 2026 18:59:25 +0200 Subject: [PATCH] test: isolate repository monitor from native watch delivery --- tests/repository-monitor.test.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/repository-monitor.test.mjs b/tests/repository-monitor.test.mjs index 810695f..cf99abc 100644 --- a/tests/repository-monitor.test.mjs +++ b/tests/repository-monitor.test.mjs @@ -83,11 +83,12 @@ test('a watched repository is read on filesystem activity instead of on every in await monitor.tick(); assert.equal(reads.length, 1); - // fs.watch can be constructed before the underlying native watch has - // finished subscribing (notably on Linux overlay filesystems in CI). - await new Promise((resolve) => setTimeout(resolve, 150)); revision = 2; await writeFile(path.join(root, 'feature.txt'), 'changed\n'); + // Exercise the monitor's filesystem-activity boundary deterministically. + // Native fs.watch delivery is platform/overlay specific and is covered by + // the product's safety interval rather than by this unit test. + monitor.noteFilesystemChange(root); // The watcher debounce and the per-repository cooldown both apply here. const deadline = Date.now() + 5_000; while (changes.length === 0 && Date.now() < deadline) {