fix(e2e): cancel Open WebUI probe body reads

This commit is contained in:
Vincent Koc
2026-06-19 07:37:28 +02:00
parent df261fabb3
commit 2dbbef46bb
2 changed files with 87 additions and 47 deletions

View File

@@ -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") {