test: remove gateway restart delay wait · openclaw/openclaw@627b007
steipete
·
2026-05-06
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -627,9 +627,13 @@ describe("runGatewayLoop", () => {
|
627 | 627 | await withIsolatedSignals(async ({ captureSignal }) => { |
628 | 628 | const { runtime, exited } = await createSignaledLoopHarness(); |
629 | 629 | const sigusr1 = captureSignal("SIGUSR1"); |
630 | | -const startedAt = Date.now(); |
631 | 630 | |
| 631 | +vi.useFakeTimers(); |
632 | 632 | sigusr1(); |
| 633 | +await vi.advanceTimersByTimeAsync(1499); |
| 634 | +expect(runtime.exit).not.toHaveBeenCalled(); |
| 635 | +await vi.advanceTimersByTimeAsync(1); |
| 636 | + |
633 | 637 | await expect(exited).resolves.toBe(0); |
634 | 638 | expect(runtime.exit).toHaveBeenCalledWith(0); |
635 | 639 | expect(writeGatewayRestartHandoffSync).toHaveBeenCalledWith({ |
@@ -638,9 +642,9 @@ describe("runGatewayLoop", () => {
|
638 | 642 | processInstanceId: expect.any(String), |
639 | 643 | supervisorMode: "launchd", |
640 | 644 | }); |
641 | | -expect(Date.now() - startedAt).toBeGreaterThanOrEqual(1400); |
642 | 645 | }); |
643 | 646 | } finally { |
| 647 | +vi.useRealTimers(); |
644 | 648 | delete process.env.LAUNCH_JOB_LABEL; |
645 | 649 | if (originalPlatformDescriptor) { |
646 | 650 | Object.defineProperty(process, "platform", originalPlatformDescriptor); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。