@@ -4,6 +4,7 @@ import fs from "node:fs";
44import { createServer , type Server } from "node:http" ;
55import os from "node:os" ;
66import path from "node:path" ;
7+ import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion" ;
78import { describe , expect , it } from "vitest" ;
89import { createBoundedChildOutput } from "../helpers/bounded-child-output.js" ;
910
@@ -236,4 +237,30 @@ describe("e2e helper numeric env limits", () => {
236237 ) . resolves . toBe ( true ) ;
237238 expect ( canceled ) . toBe ( true ) ;
238239 } ) ;
240+
241+ it ( "clamps oversized Open WebUI HTTP probe timers before scheduling" , async ( ) => {
242+ const { probeHttpStatus } = await import ( "../../scripts/e2e/lib/openwebui/http-probe.mjs" ) ;
243+ const fetchImpl = ( async ( _url : string , init : RequestInit ) => {
244+ await new Promise < void > ( ( resolve , reject ) => {
245+ const timer = setTimeout ( resolve , 25 ) ;
246+ init . signal ?. addEventListener (
247+ "abort" ,
248+ ( ) => {
249+ clearTimeout ( timer ) ;
250+ reject ( new Error ( "aborted" ) ) ;
251+ } ,
252+ { once : true } ,
253+ ) ;
254+ } ) ;
255+ return new Response ( null , { status : 200 } ) ;
256+ } ) as typeof fetch ;
257+
258+ await expect (
259+ probeHttpStatus ( {
260+ fetchImpl,
261+ timeoutMs : MAX_TIMER_TIMEOUT_MS + 1 ,
262+ url : "http://127.0.0.1/probe" ,
263+ } ) ,
264+ ) . resolves . toBe ( true ) ;
265+ } ) ;
239266} ) ;
0 commit comments