test: make the Ollama connection-refused test deterministic #79

Merged
james.maes merged 2 commits from fix/ollama-test-retry-flake into develop 2026-11-07 23:52:52 +00:00
Owner

The new Gitea CI (ci-workflows node.yaml) failed once on develop: OllamaProvider > complete > throws connection refused message when Ollama is not running timed out at 5000 ms. It runs the default 3 retries, whose jittered backoff (up to 1+2+4 s at random) can exceed the Vitest timeout.

Keep the retries (they cover the transport-retry branches the coverage gate counts) and assert all 4 attempts, but stub Math.random to 0 so the backoff is immediate. (A first attempt with maxRetries: 0 dropped branch coverage to 78.87% < 79%.)

🤖 Generated with Claude Code

The new Gitea CI (ci-workflows node.yaml) failed once on develop: `OllamaProvider > complete > throws connection refused message when Ollama is not running` timed out at 5000 ms. It runs the default 3 retries, whose jittered backoff (up to 1+2+4 s at random) can exceed the Vitest timeout. Keep the retries (they cover the transport-retry branches the coverage gate counts) and assert all 4 attempts, but stub `Math.random` to 0 so the backoff is immediate. (A first attempt with `maxRetries: 0` dropped branch coverage to 78.87% < 79%.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
james.maes added 1 commit 2026-11-07 23:42:51 +00:00
test: make the Ollama connection-refused test single-attempt
node / node (push) Failing after 51s
build / node (push) Failing after 51s
5499a86936
The test used the default 3 retries, whose jittered backoff (up to 1+2+4 s)
can exceed the 5 s Vitest timeout, so it failed intermittently in CI. Use
maxRetries: 0 like the other single-attempt error tests; retry behavior is
covered by the retry tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
james.maes added 1 commit 2026-11-07 23:49:28 +00:00
test: zero the retry jitter instead of disabling retries
node / node (push) Successful in 52s
build / node (push) Successful in 52s
324830218c
maxRetries: 0 dropped the transport-retry branches below the 79% branch
coverage threshold. Keep the default retries (and assert all 4 attempts) but
stub Math.random to 0 so the backoff is immediate and deterministic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
james.maes changed title from test: make the Ollama connection-refused test single-attempt to test: make the Ollama connection-refused test deterministic 2026-11-07 23:49:43 +00:00
james.maes merged commit 2a34d74bea into develop 2026-11-07 23:52:52 +00:00
james.maes deleted branch fix/ollama-test-retry-flake 2026-11-07 23:52:53 +00:00
Sign in to join this conversation.