mirror of https://github.com/openclaw/openclaw.git
test: clear msteams gate drift for gateway probe auth landing (#52513) (thanks @CodeForgeNet)
This commit is contained in:
parent
24f77d7457
commit
339a67262d
|
|
@ -1,15 +1,16 @@
|
|||
import type { Server } from "node:http";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { applyMSTeamsWebhookTimeouts } from "./webhook-timeouts.js";
|
||||
|
||||
describe("applyMSTeamsWebhookTimeouts", () => {
|
||||
it("applies default timeouts and header clamp", () => {
|
||||
const httpServer = {
|
||||
const httpServer: Pick<Server, "setTimeout" | "requestTimeout" | "headersTimeout"> = {
|
||||
setTimeout: vi.fn(),
|
||||
requestTimeout: 0,
|
||||
headersTimeout: 0,
|
||||
} as never;
|
||||
};
|
||||
|
||||
applyMSTeamsWebhookTimeouts(httpServer);
|
||||
applyMSTeamsWebhookTimeouts(httpServer as Server);
|
||||
|
||||
expect(httpServer.setTimeout).toHaveBeenCalledWith(30_000);
|
||||
expect(httpServer.requestTimeout).toBe(30_000);
|
||||
|
|
@ -17,13 +18,13 @@ describe("applyMSTeamsWebhookTimeouts", () => {
|
|||
});
|
||||
|
||||
it("uses explicit overrides and clamps headers timeout to request timeout", () => {
|
||||
const httpServer = {
|
||||
const httpServer: Pick<Server, "setTimeout" | "requestTimeout" | "headersTimeout"> = {
|
||||
setTimeout: vi.fn(),
|
||||
requestTimeout: 0,
|
||||
headersTimeout: 0,
|
||||
} as never;
|
||||
};
|
||||
|
||||
applyMSTeamsWebhookTimeouts(httpServer, {
|
||||
applyMSTeamsWebhookTimeouts(httpServer as Server, {
|
||||
inactivityTimeoutMs: 12_000,
|
||||
requestTimeoutMs: 9_000,
|
||||
headersTimeoutMs: 15_000,
|
||||
|
|
|
|||
Loading…
Reference in New Issue