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.
This commit is contained in:
Mohamed Boudra
2026-08-01 00:35:27 +02:00
committed by GitHub
parent 5f575fcdd6
commit b560c1184c
@@ -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");
});