test(e2e): 공유 fixture build 실패 시험이 잠금을 잡은 쪽을 owner로 둔다 #46

Merged
donghyeon.kang merged 2 commits from donghyeon.kang/test/shared-build-lock-order AGit into main 2026-11-13 08:55:14 +00:00
+10
View File
@@ -57,17 +57,27 @@ describe("one fixture build per e2e run", () => {
).rejects.toThrow(/fixture-b was built from another definition/u);
});
// The key's folder is the lock, and the call whose mkdir finishes first owns
// it, not the one made first: runner run 235 let the second call build and
// the first wait for its success. The waiter starts once the owner's
// builder runs, that is once the owner holds the lock.
it("fails the waiting callers with the builder's failure", async () => {
const environment = await sharedEnvironment();
let building!: () => void;
const ownerBuilds = new Promise<void>((resolve) => {
building = resolve;
});
const owner = sharedFixtureBuild(
"fixture-c",
"same",
async () => {
building();
await new Promise((resolve) => setTimeout(resolve, 50));
throw new Error("vite build exited 1");
},
environment,
);
await ownerBuilds;
const waiter = sharedFixtureBuild("fixture-c", "same", async () => ({}), environment);
await expect(owner).rejects.toThrow(/vite build exited 1/u);