From 78a877eb96c0acb87c83e1ebe23d59a844c2e513 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 13 Apr 2026 10:27:36 -0400 Subject: [PATCH] avoid lock file race in repro_diffname CLI test on windows (#8811) Co-authored-by: Claude Opus 4.6 (1M context) --- cli/test/repro_diffname.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/test/repro_diffname.test.ts b/cli/test/repro_diffname.test.ts index 83dcdc44a3..e096c52031 100644 --- a/cli/test/repro_diffname.test.ts +++ b/cli/test/repro_diffname.test.ts @@ -78,8 +78,11 @@ test("Raw app: generate-metadata must not create duplicate files when runnable k const backendDir = path.join(tempDir, "f/test/diffname_app.raw_app", "backend"); let files = await readdir(backendDir); - // After pull: files named by KEY (a, b) - expect(files.sort()).toEqual(["a.lock", "a.ts", "a.yaml", "b.lock", "b.ts", "b.yaml"]); + // After pull: files named by KEY (a, b). + // Lock files are generated asynchronously by the backend worker and may not + // have landed yet — exclude them from this precondition to avoid a Windows race. + const nonLockFiles = files.filter((f) => !f.endsWith(".lock")).sort(); + expect(nonLockFiles).toEqual(["a.ts", "a.yaml", "b.ts", "b.yaml"]); // Run generate-metadata — this previously created duplicate files named by NAME const metaResult = await backend.runCLICommand(["generate-metadata", "--yes"], tempDir);