1- import { afterEach , beforeEach , describe , expect , test } from "bun:test" ;
1+ import { afterEach , beforeEach , describe , expect , setDefaultTimeout , test } from "bun:test" ;
22import { mkdirSync , mkdtempSync , rmSync , writeFileSync } from "node:fs" ;
33import { tmpdir } from "node:os" ;
44import { join } from "node:path" ;
@@ -22,6 +22,11 @@ import { clearAccountNeedsReauth, markAccountNeedsReauth } from "../src/codex/ac
2222import { clearAccountQuota , updateAccountQuota } from "../src/codex/quota" ;
2323import type { OcxConfig } from "../src/types" ;
2424
25+ // beforeEach writes three Codex credentials (NTFS ACL harden on Windows). Under
26+ // `bun test --isolate` on a loaded windows-latest runner that can exceed the
27+ // default 5s hook budget (seen as beforeEach/afterEach timeout at ~7.6s).
28+ setDefaultTimeout ( 30_000 ) ;
29+
2530const savedCodexHome = process . env . CODEX_HOME ;
2631const savedOpencodexHome = process . env . OPENCODEX_HOME ;
2732let testDir : string ;
@@ -70,6 +75,8 @@ function codexHomeFixture(): string {
7075 return dir ;
7176}
7277
78+ // Credential writes can hit Windows ACL harden stalls under full-suite isolate
79+ // load (GHA: hook timed out ~7.6s on model_fallback terminator case).
7380beforeEach ( ( ) => {
7481 testDir = mkdtempSync ( join ( tmpdir ( ) , "ocx-subagent-fb-" ) ) ;
7582 process . env . OPENCODEX_HOME = testDir ;
@@ -81,7 +88,7 @@ beforeEach(() => {
8188 clearAccountNeedsReauth ( "account-a" ) ;
8289 clearAccountNeedsReauth ( "account-b" ) ;
8390 clearAccountNeedsReauth ( "main" ) ;
84- } ) ;
91+ } , { timeout : 30_000 } ) ;
8592
8693afterEach ( ( ) => {
8794 if ( savedCodexHome === undefined ) delete process . env . CODEX_HOME ;
@@ -95,7 +102,7 @@ afterEach(() => {
95102 clearAccountNeedsReauth ( "account-b" ) ;
96103 clearAccountNeedsReauth ( "main" ) ;
97104 rmSync ( testDir , { recursive : true , force : true } ) ;
98- } ) ;
105+ } , { timeout : 30_000 } ) ;
99106
100107describe ( "subagent model fallback chain" , ( ) => {
101108 test ( "buildSubagentModelChain dedupes and preserves order" , ( ) => {
0 commit comments