Skip to content

Commit 627b007

Browse files
committed
test: remove gateway restart delay wait
1 parent 7544bee commit 627b007

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/cli/gateway-cli/run-loop.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)