Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

test(e2e): use wall-clock task status timeout (#2729)

Nathan Colosimoc3be9c119a43
diff --git a/e2e/fixtures/fixture-tasks/evals/shared.ts b/e2e/fixtures/fixture-tasks/evals/shared.ts
index 488cb89bb..2d6b84fab 100644
--- a/e2e/fixtures/fixture-tasks/evals/shared.ts
+++ b/e2e/fixtures/fixture-tasks/evals/shared.ts
@@ -166,7 +166,9 @@ export async function waitForTaskStatus(
status: string,
): Promise<EveEvalTurn> {
let currentSession = session;
- for (let attempt = 0; attempt < 20; attempt += 1) {
+ const deadline = performance.now() + 15_000;
+ let attempt = 0;
+ while (performance.now() < deadline) {
const followed = await sendAndFollowQueuedTurn(
t,
`${verificationMessage} ${taskId}`,
@@ -190,9 +192,12 @@ export async function waitForTaskStatus(
);
return turn;
}
+ attempt += 1;
await t.sleep(100);
}
- throw new Error(`Task ${taskId} did not reach "${status}" after 20 verification attempts.`);
+ throw new Error(
+ `Task ${taskId} did not reach "${status}" within 15 seconds (${attempt} verification attempts).`,
+ );
}
function messageText(message: unknown): string {