refactor(tools): remove artificial analysis ceilings
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { expect, it, vi } from "vitest";
|
||||
import WebSocket from "ws";
|
||||
|
||||
import { startLoopbackReplay } from "../../../src/application/LoopbackReplay.js";
|
||||
@@ -91,6 +91,37 @@ it("matches bounded HTTP scripts without persisting request secrets", async () =
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps long replay delays pending and cancels them when replay closes", async () => {
|
||||
const scenario = parseProcessScenario({
|
||||
executable: "/bin/sh",
|
||||
working_directory: "/tmp",
|
||||
replay: {
|
||||
http: [
|
||||
{
|
||||
method: "GET",
|
||||
path: "/later",
|
||||
status: 200,
|
||||
body: "ready",
|
||||
delay_ms: 2_147_483_648,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
const replay = await startLoopbackReplay(scenario);
|
||||
const response = fetch(`${replay.httpUrl}/later`);
|
||||
try {
|
||||
await vi.waitFor(() => {
|
||||
expect(
|
||||
replay.events.some(({ direction }) => direction === "request"),
|
||||
).toBe(true);
|
||||
});
|
||||
await replay.close();
|
||||
await expect(response).resolves.toMatchObject({ status: 200 });
|
||||
} finally {
|
||||
await replay.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("consumes ordered WebSocket reconnect scripts and reports exhaustion", async () => {
|
||||
const scenario = parseProcessScenario({
|
||||
executable: "/bin/sh",
|
||||
|
||||
Reference in New Issue
Block a user