fix: tolerate 1-2ms setTimeout jitter in the Ollama-enrichment timeout test
All checks were successful
build-verify / build-verify (push) Successful in 18s
changelog-draft / changelog-draft (push) Successful in 4s

CI build-verify run #23 (commit 388c4f3) failed on a strict lower bound
(elapsed >= 5000) that measured 4999ms -- normal clock/timer jitter between
the two Date.now() reads, not a real regression in the 5s AbortController
timeout itself. Confirmed unrelated to that commit's actual change (a
route-glue removal). Loosened the floor to 4990ms.
This commit is contained in:
Rene Fichtmueller 2026-07-18 07:11:14 +00:00
parent f72ce5f991
commit a4506de1c5

View File

@ -210,8 +210,10 @@ describe('Hijack Detector', () => {
const elapsed = Date.now() - startTime
expect(result).toBe(baseDesc)
// AbortController timeout should trigger around 5-6 seconds
expect(elapsed).toBeGreaterThanOrEqual(5000)
// AbortController timeout should trigger around 5-6 seconds. A few ms
// of tolerance below 5000 absorbs normal setTimeout/Date.now() jitter
// between the two clock reads (observed flake: 4999ms).
expect(elapsed).toBeGreaterThanOrEqual(4990)
expect(elapsed).toBeLessThan(7000)
}, { timeout: 10000 })