mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 22:30:21 +00:00
perf(test): trim retry-loop work in embedding batch tests
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user