test(perf): dedupe fixtures and reduce flaky waits

This commit is contained in:
Peter Steinberger
2026-02-22 22:05:49 +00:00
parent b534dfa3e0
commit 7b229decdd
13 changed files with 249 additions and 239 deletions

View File

@@ -317,23 +317,12 @@ async function runTurnWithCooldownSeed(params: {
describe("runEmbeddedPiAgent auth profile rotation", () => {
it("rotates for auto-pinned profiles across retryable stream failures", async () => {
const cases = [
{
errorMessage: "rate limit",
sessionKey: "agent:test:auto",
runId: "run:auto",
},
{
errorMessage: "request ended without sending any chunks",
sessionKey: "agent:test:empty-chunk-stream",
runId: "run:empty-chunk-stream",
},
] as const;
for (const testCase of cases) {
const { usageStats } = await runAutoPinnedRotationCase(testCase);
expect(typeof usageStats["openai:p2"]?.lastUsed).toBe("number");
}
const { usageStats } = await runAutoPinnedRotationCase({
errorMessage: "rate limit",
sessionKey: "agent:test:auto",
runId: "run:auto",
});
expect(typeof usageStats["openai:p2"]?.lastUsed).toBe("number");
});
it("rotates on timeout without cooling down the timed-out profile", async () => {