File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -478,14 +478,21 @@ describe("waitForAgentRunsToDrain", () => {
478478 callGatewayMock . mockResolvedValue ( { status : "ok" } ) ;
479479 let activeRunIds = [ "run-1" ] ;
480480
481- const result = await waitForAgentRunsToDrain ( {
482- timeoutMs : Number . NaN ,
483- getPendingRunIds : ( ) => {
484- const current = activeRunIds ;
485- activeRunIds = [ ] ;
486- return current ;
487- } ,
488- } ) ;
481+ vi . useFakeTimers ( ) ;
482+ vi . setSystemTime ( new Date ( "2026-01-01T00:00:00.000Z" ) ) ;
483+ let result : Awaited < ReturnType < typeof waitForAgentRunsToDrain > > ;
484+ try {
485+ result = await waitForAgentRunsToDrain ( {
486+ timeoutMs : Number . NaN ,
487+ getPendingRunIds : ( ) => {
488+ const current = activeRunIds ;
489+ activeRunIds = [ ] ;
490+ return current ;
491+ } ,
492+ } ) ;
493+ } finally {
494+ vi . useRealTimers ( ) ;
495+ }
489496
490497 expect ( result . timedOut ) . toBe ( false ) ;
491498 expect ( Number . isFinite ( result . deadlineAtMs ) ) . toBe ( true ) ;
You can’t perform that action at this time.
0 commit comments