Skip to content

Find code by asking what it does. A CLI for coding agents that uses Jev to discover relevant files and source context.

Make concurrent snapshot mutation test independent of tmpfs clock ticks

David Zhang32ff98d411e2
diff --git a/packages/core/test/filesystem.test.ts b/packages/core/test/filesystem.test.ts
index d532c2a..37078be 100644
--- a/packages/core/test/filesystem.test.ts
+++ b/packages/core/test/filesystem.test.ts
@@ -205,8 +205,10 @@ test("snapshots preserve exact source and change hashes for same-size edits with
}
});
-test("a file changed between OS reads is incomplete and never yields mixed source", async () => {
+test("an observable same-size change between OS reads is incomplete", async () => {
const root = await fixture({ changing: "original bytes" });
+ // Two real writes can share a tmpfs clock tick; pin the initial mtime so this writer is observable.
+ await utimes(join(root, "changing"), 0, 0);
const probe = await open(join(root, "changing"));
const prototype = Object.getPrototypeOf(probe);
const originalRead = prototype.read;