Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/codex-integration/token-guardian.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { tmpdir } from "node:os";
import { join } from "node:path";
import { saveCredential } from "../../src/oauth/store";
import { getConfigPath } from "../../src/config";
import { flushConfigDirHardening } from "../../src/config/paths";
import { markCodexAccountValidated, readCodexAccountRecord, saveCodexAccountCredential } from "../../src/codex/account-store";
import { __resetGuardianState, guardianSweep } from "../../src/oauth/token-guardian";
import type { OcxConfig, OcxProviderConfig } from "../../src/types";
Expand Down Expand Up @@ -46,7 +47,9 @@ beforeEach(() => {
__resetGuardianState();
});

afterEach(() => {
afterEach(async () => {
// Optional Windows ACL work can outlive credential writes and keep this home open.
await flushConfigDirHardening(join(tmp, "ocx"));
resetLifecycleDrainStateForTests();
if (origHome === undefined) delete process.env.HOME; else process.env.HOME = origHome;
if (origOcxHome === undefined) delete process.env.OPENCODEX_HOME; else process.env.OPENCODEX_HOME = origOcxHome;
Expand Down
Loading