test: isolate repository monitor from native watch delivery
Managed validation / full (pull_request) Canceled after 0s
ForgeFlow quality gate / quality (pull_request) Successful in 6m43s
ForgeFlow quality gate / secret-scan (pull_request) Failing after 15s

This commit is contained in:
NuklearRabbit
2026-08-27 18:59:25 +02:00
parent a4e006f455
commit 25f4b9eac1
+4 -3
View File
@@ -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) {