From e67f67146eb06bfa7bc7b766143a8dccbfb84c2e Mon Sep 17 00:00:00 2001 From: Engineer Date: Tue, 1 Sep 2026 20:43:35 -0500 Subject: [PATCH] test(runner): wait for admission cleanup lease release --- .../src/drivers/acpx/runtime-host.test.ts | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/paperclip-runner/src/drivers/acpx/runtime-host.test.ts b/packages/paperclip-runner/src/drivers/acpx/runtime-host.test.ts index f5eb29f0bf..b262b7f293 100644 --- a/packages/paperclip-runner/src/drivers/acpx/runtime-host.test.ts +++ b/packages/paperclip-runner/src/drivers/acpx/runtime-host.test.ts @@ -472,18 +472,17 @@ describe("ACPX runtime host", () => { ).rejects.toThrow("already has an active lease"); resolveRetryClose(); - await vi.waitFor(async () => { - await expect(readFile(authPath)).rejects.toMatchObject({ - code: "ENOENT", - }); - }); - const contender = await stageManagedCodexCredential({ - agentHomeDirectory: credentialHome, - environment: { - PAPERCLIP_ACPX_CODEX_AUTH_JSON_SECRET: '{"owner":"contender"}', - }, - }); + const contender = await vi.waitFor(() => + stageManagedCodexCredential({ + agentHomeDirectory: credentialHome, + environment: { + PAPERCLIP_ACPX_CODEX_AUTH_JSON_SECRET: '{"owner":"contender"}', + }, + }), + ); + await expect(readFile(authPath, "utf8")).resolves.toContain("contender"); await contender.close(); + await expect(readFile(authPath)).rejects.toMatchObject({ code: "ENOENT" }); }); it("bounds post-handshake model verification and cleans the runtime", async () => {