test(server): read the latest event when checking a removed file on macOS (#9898)
macOS FSEvents can replay the file's pre-subscription write as a create after the observer starts. The test read the first event for the path, so it stayed on that create after the delete arrived in a later batch. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6ef188416f
commit
3a7e216b7d
1 file changed
+4
-3
@@ -193,10 +193,11 @@ test("classifies a removed file as deleted", async () => {
|
||||
});
|
||||
|
||||
await rm(target);
|
||||
// Native recursive delivery can be coalesced before the backend's deletion audit.
|
||||
// Assert eventual classification without imposing Vitest's one-second default.
|
||||
// macOS FSEvents can replay the write above as a create after the subscription starts,
|
||||
// so the delete is the latest event for the path, not the first. Native recursive delivery
|
||||
// can also be coalesced before the backend's deletion audit, hence the longer timeout.
|
||||
await expect
|
||||
.poll(() => events.find((event) => event.path === target)?.type, { timeout: 10_000 })
|
||||
.poll(() => events.findLast((event) => event.path === target)?.type, { timeout: 10_000 })
|
||||
.toBe("delete");
|
||||
await subscription.unsubscribe();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user