mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:00:44 +00:00
test: remove gateway restart delay wait
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user