test: remove gateway restart delay wait

This commit is contained in:
Peter Steinberger
2026-05-06 07:02:23 +01:00
parent 7544beea17
commit 627b0073f2

View File

@@ -627,9 +627,13 @@ describe("runGatewayLoop", () => {
await withIsolatedSignals(async ({ captureSignal }) => {
const { runtime, exited } = await createSignaledLoopHarness();
const sigusr1 = captureSignal("SIGUSR1");
const startedAt = Date.now();
vi.useFakeTimers();
sigusr1();
await vi.advanceTimersByTimeAsync(1499);
expect(runtime.exit).not.toHaveBeenCalled();
await vi.advanceTimersByTimeAsync(1);
await expect(exited).resolves.toBe(0);
expect(runtime.exit).toHaveBeenCalledWith(0);
expect(writeGatewayRestartHandoffSync).toHaveBeenCalledWith({
@@ -638,9 +642,9 @@ describe("runGatewayLoop", () => {
processInstanceId: expect.any(String),
supervisorMode: "launchd",
});
expect(Date.now() - startedAt).toBeGreaterThanOrEqual(1400);
});
} finally {
vi.useRealTimers();
delete process.env.LAUNCH_JOB_LABEL;
if (originalPlatformDescriptor) {
Object.defineProperty(process, "platform", originalPlatformDescriptor);