@@ -15,6 +15,11 @@ import { bootstrapApplication } from "./bootstrap.ts";
1515import type { ApplicationContext } from "./context.ts" ;
1616import { loadSettings , saveSettings } from "./settings.ts" ;
1717
18+ // Startup progress (dynamic imports, gateway subscribe, router start) is not a
19+ // performance assertion, so these waits must not inherit vi.waitFor's 1s default:
20+ // under a loaded CI runner that budget expires before startup reaches the step.
21+ const STARTUP_STEP_WAIT = { timeout : 15_000 } ;
22+
1823function deferred < T > ( ) {
1924 let resolve ! : ( value : T ) => void ;
2025 const promise = new Promise < T > ( ( resolvePromise ) => {
@@ -366,7 +371,7 @@ describe("normalizeInitialApplicationLocation", () => {
366371 features : { methods : [ "openclaw.setup.detect" ] } ,
367372 } ,
368373 } as Parameters < GatewayListener > [ 0 ] ) ;
369- await vi . waitFor ( ( ) => expect ( replaceRoute ) . toHaveBeenCalledOnce ( ) ) ;
374+ await vi . waitFor ( ( ) => expect ( replaceRoute ) . toHaveBeenCalledOnce ( ) , STARTUP_STEP_WAIT ) ;
370375 expect ( replaceRoute ) . toHaveBeenCalledWith ( "model-setup" , { search : "?firstRun=1" } ) ;
371376 } ) ;
372377
@@ -515,7 +520,7 @@ describe("normalizeInitialApplicationLocation", () => {
515520
516521 try {
517522 const start = runtime . start ( ) ;
518- await vi . waitFor ( ( ) => expect ( activeSubscriptions . size ) . toBe ( 1 ) ) ;
523+ await vi . waitFor ( ( ) => expect ( activeSubscriptions . size ) . toBe ( 1 ) , STARTUP_STEP_WAIT ) ;
519524 runtime . stop ( ) ;
520525 await start ;
521526
@@ -545,7 +550,7 @@ describe("normalizeInitialApplicationLocation", () => {
545550
546551 try {
547552 const start = runtime . start ( ) ;
548- await vi . waitFor ( ( ) => expect ( routerStart ) . toHaveBeenCalledOnce ( ) ) ;
553+ await vi . waitFor ( ( ) => expect ( routerStart ) . toHaveBeenCalledOnce ( ) , STARTUP_STEP_WAIT ) ;
549554 runtime . stop ( ) ;
550555 expect ( routerStop ) . toHaveBeenCalledOnce ( ) ;
551556
0 commit comments