Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: increase eval attempts (#1889)

Max Deichmanneb03ffaf854d
diff --git a/worker/src/__tests__/redis-consumer.test.ts b/worker/src/__tests__/redis-consumer.test.ts
index 93f04b9bce..bccfcc68c2 100644
--- a/worker/src/__tests__/redis-consumer.test.ts
+++ b/worker/src/__tests__/redis-consumer.test.ts
@@ -6,7 +6,7 @@ import { z } from "zod";
import logger from "../logger";
import { evalJobCreator } from "../redis/consumer";
-describe("handle redis events", () => {
+describe.sequential("handle redis events", () => {
test("handle redis job succeeding", async () => {
vi.mock("../eval-service", () => ({
createEvalJobs: async ({
@@ -41,8 +41,57 @@ describe("handle redis events", () => {
expect(jobState).toEqual("completed");
},
{
- timeout: 10_000,
+ timeout: 20_000,
}
);
- }, 10_000);
+ }, 20_000);
+
+ // test("handle redis job failing", async () => {
+ // vi.mock("../eval-service", () => ({
+ // createEvalJobs: async ({
+ // data,
+ // }: {
+ // data: z.infer<typeof TraceUpsertEvent>;
+ // }) => {
+ // logger.error("Failed to create eval jobs");
+ // throw new Error("Failed to create eval jobs");
+ // },
+ // }));
+
+ // // this activates the consumer
+ // evalJobCreator?.on("completed", (job, err) => {
+ // logger.info(`Eval Job with id ${job?.id} completed`);
+ // });
+
+ // expect(evalQueue).toBeDefined();
+
+ // const job = await evalQueue?.add(
+ // QueueJobs.TraceUpsert,
+ // {
+ // id: randomUUID(),
+ // timestamp: new Date(),
+ // payload: {
+ // projectId: "project-id",
+ // traceId: "trace-id",
+ // },
+ // name: QueueJobs.TraceUpsert as const,
+ // },
+ // {
+ // attempts: 2,
+ // }
+ // );
+
+ // await vi.waitFor(
+ // async () => {
+ // const jobState = await evalQueue?.getJobState(job!.id!);
+ // logger.info(`Job state: ${jobState}`);
+ // expect(jobState).toEqual("failed");
+ // const j = await evalQueue?.getJob(job!.id!);
+ // expect(j?.attemptsMade).toEqual(2);
+ // },
+ // {
+ // timeout: 15_000,
+ // }
+ // );
+ // }, 15_000);
});
diff --git a/worker/src/eval-service.ts b/worker/src/eval-service.ts
index cbd242c105..2ae9c85ccb 100644
--- a/worker/src/eval-service.ts
+++ b/worker/src/eval-service.ts
@@ -128,7 +128,7 @@ export const createEvalJobs = async ({
},
},
{
- attempts: 5,
+ attempts: 10,
backoff: {
type: "exponential",
delay: 1000,