From 161ed9157134d5c3b0fbae19ceb756ac58a26c04 Mon Sep 17 00:00:00 2001 From: Ysopwnable <161784452+N0zoM1z0@users.noreply.github.com> Date: Thu, 8 Oct 2026 00:24:44 +0800 Subject: [PATCH] test(process): wait for observable snapshot ctime changes (#999) --- src/application/FilesystemSnapshot.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/application/FilesystemSnapshot.test.ts b/src/application/FilesystemSnapshot.test.ts index 3725fc149..b7e141018 100644 --- a/src/application/FilesystemSnapshot.test.ts +++ b/src/application/FilesystemSnapshot.test.ts @@ -58,8 +58,13 @@ it("rejects a same-size rewrite even when its modification time is restored", as await writeFile(path, "before\n"); await utimes(path, fixedMtime, fixedMtime); const expected = await lstat(path); - await writeFile(path, "after!\n"); - await utimes(path, fixedMtime, fixedMtime); + await expect + .poll(async () => { + await writeFile(path, "after!\n"); + await utimes(path, fixedMtime, fixedMtime); + return (await lstat(path)).ctimeMs; + }) + .not.toBe(expected.ctimeMs); const rewritten = await lstat(path); expect(rewritten).toMatchObject({