From b560c1184cdb39db3215298c6776fcf89b3c14e7 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sat, 1 Aug 2026 00:35:27 +0200 Subject: [PATCH] test(server): wait for terminal env marker contents (#2715) The Windows runner could observe the marker after creation but before its contents were written. Wait for the expected value so the test synchronizes on the behavior it asserts. --- packages/server/src/terminal/terminal-manager.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/server/src/terminal/terminal-manager.test.ts b/packages/server/src/terminal/terminal-manager.test.ts index f08b1a4ff..47905d142 100644 --- a/packages/server/src/terminal/terminal-manager.test.ts +++ b/packages/server/src/terminal/terminal-manager.test.ts @@ -202,7 +202,10 @@ it("inherits registered env for the worktree root cwd", async () => { ], }); - await waitForCondition(() => existsSync(markerPath), 10000); + await waitForCondition( + () => existsSync(markerPath) && readFileSync(markerPath, "utf8") === "45678", + 10000, + ); expect(readFileSync(markerPath, "utf8")).toBe("45678"); }); @@ -228,7 +231,10 @@ it("inherits registered env for subdirectories within the worktree", async () => ], }); - await waitForCondition(() => existsSync(markerPath), 10000); + await waitForCondition( + () => existsSync(markerPath) && readFileSync(markerPath, "utf8") === "45679", + 10000, + ); expect(readFileSync(markerPath, "utf8")).toBe("45679"); });