Skip to content

7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

TypeScript

test: tolerate small start_offset_ms in single-attempt trace test (#606)

Tashfeenb40b65e66b9e
diff --git a/server/src/__tests__/lib/request-attempts.test.ts b/server/src/__tests__/lib/request-attempts.test.ts
index 7f95ae3f..5a668929 100644
--- a/server/src/__tests__/lib/request-attempts.test.ts
+++ b/server/src/__tests__/lib/request-attempts.test.ts
@@ -180,8 +180,12 @@ describe('per-attempt routing traces', () => {
model_id: 'solo-model',
key_ordinal: 1,
outcome: 'ok',
- start_offset_ms: 0,
});
+ // Wall-clock delta between trace start and first dispatch: 0 on a fast
+ // machine, a few ms on a loaded CI runner — assert small, not exactly 0
+ // (flaked on the Node 22 CI job).
+ expect(rows[0].start_offset_ms).toBeGreaterThanOrEqual(0);
+ expect(rows[0].start_offset_ms).toBeLessThan(1000);
expect(rows[0].duration_ms).toBeGreaterThanOrEqual(0);
});