mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-24 06:49:31 +00:00
fix(e2e): cancel Open WebUI probe body reads
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// Openwebui Probe tests cover openwebui probe script behavior.
|
||||
import { spawn } from "node:child_process";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { createServer, type IncomingMessage, type Server as HttpServer } from "node:http";
|
||||
import { createServer as createTcpServer, type Server as TcpServer, type Socket } from "node:net";
|
||||
import path from "node:path";
|
||||
@@ -186,6 +187,16 @@ describe("scripts/e2e/openwebui-probe.mjs", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("passes Open WebUI request timeouts into bounded body reads", () => {
|
||||
const script = readFileSync(probePath, "utf8");
|
||||
|
||||
expect(script).toContain("run(controller.signal, timeoutPromise)");
|
||||
expect(script).toMatch(
|
||||
/readBoundedResponseTextWithLimit\(\s*response,\s*label,\s*responseBodyMaxBytes,\s*timeoutPromise,/u,
|
||||
);
|
||||
expect(script.match(/async \(signal, timeoutPromise\)/gu)).toHaveLength(3);
|
||||
});
|
||||
|
||||
it("bounds sign-in error response bodies", async () => {
|
||||
const server = createServer((request, response) => {
|
||||
if (request.url === "/api/v1/auths/signin") {
|
||||
|
||||
Reference in New Issue
Block a user