From faeac955b5b3b7ebde51481718d1b8b4c3c4df1c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 13 Feb 2026 22:42:03 +0000 Subject: [PATCH] perf(test): trim retry-loop work in embedding batch tests --- src/memory/manager.embedding-batches.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/memory/manager.embedding-batches.test.ts b/src/memory/manager.embedding-batches.test.ts index 371b3e6ff17..db59e21310a 100644 --- a/src/memory/manager.embedding-batches.test.ts +++ b/src/memory/manager.embedding-batches.test.ts @@ -169,7 +169,7 @@ describe("memory embedding batches", () => { let calls = 0; embedBatch.mockImplementation(async (texts: string[]) => { calls += 1; - if (calls < 3) { + if (calls < 2) { throw new Error("openai embeddings failed: 429 rate limit"); } return texts.map(() => [0, 1, 0]); @@ -217,7 +217,7 @@ describe("memory embedding batches", () => { setTimeoutSpy.mockRestore(); } - expect(calls).toBe(3); + expect(calls).toBe(2); }, 10000); it("retries embeddings on transient 5xx errors", async () => { @@ -228,7 +228,7 @@ describe("memory embedding batches", () => { let calls = 0; embedBatch.mockImplementation(async (texts: string[]) => { calls += 1; - if (calls < 3) { + if (calls < 2) { throw new Error("openai embeddings failed: 502 Bad Gateway (cloudflare)"); } return texts.map(() => [0, 1, 0]); @@ -276,7 +276,7 @@ describe("memory embedding batches", () => { setTimeoutSpy.mockRestore(); } - expect(calls).toBe(3); + expect(calls).toBe(2); }, 10000); it("skips empty chunks so embeddings input stays valid", async () => {