test: unpin the Ollama abort regression from port 11434 and make it actually exercise the abort#956
Open
gorkem2020 wants to merge 2 commits into
Open
Conversation
The mock bound 127.0.0.1:11434 to satisfy isOllamaProvider(), which EADDRINUSEs on any host running a real Ollama and killed the whole test chain at position 3. Use an ephemeral port with an /ollama path baseURL (the detection regex's third alternative) instead. Also fixes a pre-existing false pass: the mock served /v1/embeddings but the Ollama-native route posts to /api/embeddings (v1 stripped), so the request 404ed instantly and the abort path was never exercised anywhere - the elapsed assertion had no lower bound, so a 3ms failure passed. The mock now serves the real path and the test requires the request to hang until the abort fires. (cherry picked from commit 742c6a3)
gorkem2020
marked this pull request as ready for review
July 20, 2026 09:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two defects in the Ollama abort regression (Test 8 of the CJK suite), found while running the full chain on a host with a real Ollama install:
The mock bound 127.0.0.1:11434 to satisfy the provider detector, which EADDRINUSEs on any machine running a real Ollama and kills the whole npm test chain at position 3. The mock now listens on an ephemeral port and satisfies the detector through the /ollama path alternative of its regex instead.
A pre-existing false pass: the mock served /v1/embeddings, but the Ollama-native route strips the /v1 suffix and posts to /api/embeddings, so the request 404ed instantly (about 3ms) and the elapsed assertion, which only had an upper bound, passed without the abort path ever running, on any machine including CI. The mock now serves the real path and the test requires the request to hang until the external AbortSignal fires (verified about 2000ms).
With this change the full test chain runs green end to end on hosts with and without a local Ollama.