From 268e3424ddd1f19d847b8517f88d0e968c9a11cc Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 1 Aug 2025 00:20:43 +0000 Subject: [PATCH] Fix duration calculation for cached test runs Co-authored-by: me --- bench/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bench/index.ts b/bench/index.ts index b2f08d3..7d00886 100644 --- a/bench/index.ts +++ b/bench/index.ts @@ -652,7 +652,8 @@ export async function testRunner(options: TestRunnerOptions) { ); } - const duration = Date.now() - startTime; + // Use the original cached duration, not the time to retrieve from cache + const duration = testRun.reuseFrom.duration || 0; const reused = testRun.reuseFrom; const text = reused.text; const correct = isCorrect({ @@ -912,7 +913,8 @@ export async function testRunner(options: TestRunnerOptions) { ); } - const duration = Date.now() - startTime; + // Use the original cached duration, not the time to retrieve from cache + const duration = r.duration || 0; const text = r.text; const correct = isCorrect({ answers: testRun.answers,