File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -627,9 +627,13 @@ describe("runGatewayLoop", () => {
627627 await withIsolatedSignals ( async ( { captureSignal } ) => {
628628 const { runtime, exited } = await createSignaledLoopHarness ( ) ;
629629 const sigusr1 = captureSignal ( "SIGUSR1" ) ;
630- const startedAt = Date . now ( ) ;
631630
631+ vi . useFakeTimers ( ) ;
632632 sigusr1 ( ) ;
633+ await vi . advanceTimersByTimeAsync ( 1499 ) ;
634+ expect ( runtime . exit ) . not . toHaveBeenCalled ( ) ;
635+ await vi . advanceTimersByTimeAsync ( 1 ) ;
636+
633637 await expect ( exited ) . resolves . toBe ( 0 ) ;
634638 expect ( runtime . exit ) . toHaveBeenCalledWith ( 0 ) ;
635639 expect ( writeGatewayRestartHandoffSync ) . toHaveBeenCalledWith ( {
@@ -638,9 +642,9 @@ describe("runGatewayLoop", () => {
638642 processInstanceId : expect . any ( String ) ,
639643 supervisorMode : "launchd" ,
640644 } ) ;
641- expect ( Date . now ( ) - startedAt ) . toBeGreaterThanOrEqual ( 1400 ) ;
642645 } ) ;
643646 } finally {
647+ vi . useRealTimers ( ) ;
644648 delete process . env . LAUNCH_JOB_LABEL ;
645649 if ( originalPlatformDescriptor ) {
646650 Object . defineProperty ( process , "platform" , originalPlatformDescriptor ) ;
You can’t perform that action at this time.
0 commit comments