test(runner): await failed admission lease release

This commit is contained in:
Dotta 2026-09-03 07:13:15 -05:00
parent 981fb0fe86
commit 183b0124de
1 changed files with 12 additions and 6 deletions

View File

@ -604,12 +604,18 @@ describe("ACPX runtime host", () => {
code: "ENOENT",
});
});
const contender = await stageManagedCodexCredential({
agentHomeDirectory: credentialHome,
environment: {
PAPERCLIP_ACPX_CODEX_AUTH_JSON_SECRET: '{"owner":"contender"}',
},
});
// File removal precedes kernel lease release. Wait for the lease itself so
// this assertion cannot race between those two ordered cleanup steps.
const contender = await vi.waitFor(
() =>
stageManagedCodexCredential({
agentHomeDirectory: credentialHome,
environment: {
PAPERCLIP_ACPX_CODEX_AUTH_JSON_SECRET: '{"owner":"contender"}',
},
}),
{ timeout: 5_000 },
);
await contender.close();
});