Repository navigation
CI: stabilize ollama-live instead of masking its flake - #179
Merged
Merged
Conversation
ollama-live (ubuntu-latest) failed 3 of the last 12 live-llm runs with an identical signature: Ollama's bundled llama-server segfaults, both chat tests take a bare HTTP 500 with no body, embed passes. macOS never reproduced it on the same test code. The test assertions were never the problem — the strongest one is `!answer.trim().is_empty()`, and nothing checks model output — so there is nothing to loosen. Address the trigger instead: - Run the three tests serially. They otherwise land two concurrent chat requests on one qwen runner, which is the shape that crashes. - Pin OLLAMA_MAX_LOADED_MODELS/OLLAMA_NUM_PARALLEL on `ollama serve`, not on the cargo step, which is the only process that reads them. - Stop the systemd unit the Linux installer starts. It already owned :11434, so the old `ollama serve &` silently lost the bind and the job ran against an unconfigured instance (visible as "address already in use" in run 29944352897). Without this the env above would be ignored on Linux. - Dump the server log on failure. A segfault reaches the test as an empty 500, which is why this recurred three times undiagnosed. Verified locally against Ollama with the CI models: 3 passed in 1.44s. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
ollama-live (ubuntu-latest)failed 3 of the last 12live-llmruns with a byte-identical signature:Every time:
embed_returns_a_vectorpasses in ~0.4s, then both chat tests die on the same crashed runner. Always ubuntu, never macOS, on identical test code.(Two other red runs —
29944352897,29944374576— failed all four jobs oncannot update the lock file ... because --locked was passed. That was the stale lockfile, fixed by #178, not flake.)Why not just relax the assertions
That was the first instinct, but there is nothing left to loosen. The strongest assertions in
llm_backend_live.rsare!answer.trim().is_empty()and!assembled.trim().is_empty(); no test inspects model output at all —"Reply with exactly the word: pong"isn't even checked against "pong". The failure is an HTTP 500 with an empty body because Ollama's subprocess died, so the only thing that would turn it green iscontinue-on-error, which doesn't relax a threshold — it removes the job's ability to report anything. This is the sole coverage of the OpenAI-compat wire format and theLlmFlavour::Ollamashim, so that trade seemed bad.What this changes
qwen2.5:0.5brunner — the shape in which Ollama segfaults.OLLAMA_MAX_LOADED_MODELS/OLLAMA_NUM_PARALLELonollama serve, not on the cargo step. Those vars are read by the server process; on the test step they would have done nothing.:11434, so the oldollama serve &silently lost the bind and the job passed against an unconfigured instance — visible asbind: address already in usein run29944352897. Without this, the env above is ignored on Linux.No test file is touched; no assertion is weakened.
Verification
Ran locally against Ollama with the CI models (
qwen2.5:0.5b,all-minilm):Caveats
The concurrency diagnosis is inference from the timing, the ubuntu/macOS split, and which test survives — not a captured stack trace. The log dump is what will confirm or refute it on the next occurrence. Given a 25% base rate, a few green runs won't be proof either; if it recurs, the log will finally say why, and the fallback is one bounded retry of the step rather than
continue-on-error.--test-threads=1also makes the job strictly serial, which costs a little wall time (~1.4s of test execution here, dwarfed by model pulls).🤖 Generated with Claude Code