From 6ed37963233c10295a4dc19de566d07be1cc7ab8 Mon Sep 17 00:00:00 2001 From: Tim Nunamaker Date: Sat, 24 Oct 2026 00:35:34 -0500 Subject: [PATCH] test(autostart): read only committed command files in the native-failure test The store writes each command to .json..tmp and renames it. The test took the first directory entry, so a read during that window answered a temporary name and the request timed out with "was not applied by the desktop app". Filter to .json names, as the test's own helper already does. Under 32-way parallel load the old test failed 4 of 64 runs and the new one 0 of 64. Signed-off-by: Tim Nunamaker Assisted-by: AI --- reference-implementation/test/autostart-store.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference-implementation/test/autostart-store.test.ts b/reference-implementation/test/autostart-store.test.ts index 21d113977..d19d74a44 100644 --- a/reference-implementation/test/autostart-store.test.ts +++ b/reference-implementation/test/autostart-store.test.ts @@ -83,7 +83,8 @@ test("failed native result is rejected for that command", async () => { const path = join(dir, "autostart-commands"); let commandId = ""; for (let attempt = 0; attempt < 100; attempt += 1) { - const files = await readdir(path).catch(() => []); + // The store writes .json..tmp and renames it; only a committed command file names the id. + const files = (await readdir(path).catch(() => [])).filter(name => name.endsWith(".json")); if (files.length) { commandId = files[0]!.replace(".json", ""); break; } await new Promise(resolve => setTimeout(resolve, 5)); }