fix: parse feishu startup timeout env strictly · openclaw/openclaw@a8991e0
steipete
·
2026-05-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,7 @@ import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/plugin-test-runt
|
2 | 2 | import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest"; |
3 | 3 | import type { ClawdbotConfig } from "../runtime-api.js"; |
4 | 4 | import { monitorFeishuProvider, stopFeishuMonitor } from "./monitor.js"; |
| 5 | +import { resolveStartupProbeTimeoutMs } from "./monitor.startup.js"; |
5 | 6 | |
6 | 7 | const probeFeishuMock = vi.hoisted(() => vi.fn()); |
7 | 8 | |
@@ -64,6 +65,19 @@ afterAll(() => {
|
64 | 65 | }); |
65 | 66 | |
66 | 67 | describe("Feishu monitor startup preflight", () => { |
| 68 | +it("parses startup probe timeout env strictly", () => { |
| 69 | +expect(resolveStartupProbeTimeoutMs({})).toBe(30_000); |
| 70 | +expect( |
| 71 | +resolveStartupProbeTimeoutMs({ OPENCLAW_FEISHU_STARTUP_PROBE_TIMEOUT_MS: "90000" }), |
| 72 | +).toBe(90_000); |
| 73 | + |
| 74 | +for (const value of ["0x10", "1e3", "10.5"]) { |
| 75 | +expect( |
| 76 | +resolveStartupProbeTimeoutMs({ OPENCLAW_FEISHU_STARTUP_PROBE_TIMEOUT_MS: value }), |
| 77 | +).toBe(30_000); |
| 78 | +} |
| 79 | +}); |
| 80 | + |
67 | 81 | it("starts account probes sequentially to avoid startup bursts", async () => { |
68 | 82 | let inFlight = 0; |
69 | 83 | let maxInFlight = 0; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。