Skip to content

fix: run_tests_with_ollama.sh proceeds silently when Ollama warmup times out #759

Closed

Description

@ajbozarth

Summary

The run_tests_with_ollama.sh script has a fast path for when it detects an existing Ollama server (lines 82–84), but it blindly trusts that server without verifying it is actually functional. If the existing server is in a bad state, the entire test run fails with Ollama connectivity errors rather than a clear setup failure.

What goes wrong

When the script detects Ollama already running, it skips starting its own server and proceeds directly to model pulls and warmups. If a warmup times out, the script logs a warning but carries on anyway:

Warning: warmup for granite4:micro timed out (will load on first test)

The subsequent tests then error with "could not create OllamaModelBackend: ollama server not running at None" rather than failing fast. The run still takes the full ~80 minutes working through connection timeouts on every affected test before reporting the failures.

Suggested improvements

  • Treat a warmup timeout as a fatal error rather than a warning — either die() with a clear message or attempt to restart the server
  • When reusing an existing server, verify it is responsive with a lightweight check (e.g. ollama ps) before proceeding to warmups
  • Consider adding a --force-restart-ollama flag for environments where stale servers are common

Context

Encountered during a manual cluster test run on an IBM LSF p-series GPU node (preemptable queue). The node had a stale Ollama server from a previous session that was running but unresponsive. Re-running after confirming no Ollama process was running produced a clean result.

Activity

  1. ajbozarth commented on Mar 27, 2026

    @ajbozarth
    MemberAuthor
  2. ajbozarth commented on Mar 27, 2026

    @ajbozarth
    MemberAuthor

    found when testing #742

  3. ajbozarth commented on Mar 31, 2026

    @ajbozarth
    MemberAuthor

    @avinash2692 did #765 fix this? should it be closed?

  4. ajbozarth commented on Apr 20, 2026

    @ajbozarth
    MemberAuthor

    Updated status from Claude:

    Checked current main (2026-04-20) — partially addressed by PR #765 and subsequent script work, but not fully resolved.

    Fixed: the root cause of the original reported failure (stale unresponsive server). The renamed script (test/scripts/run_tests_with_ollama_and_vllm.sh) now does a curl .../api/tags health check before reusing an existing server, so a non-responsive Ollama process is no longer silently trusted. OLLAMA_EXTERNAL=1 and OLLAMA_SKIP_WARMUP=1 env guards were also added.

    Still open: a warmup timeout is still logged as a warning (Warning: warmup for $model timed out) rather than treated as a fatal error. The --force-restart-ollama flag was not added.

  5. ajbozarth commented on Apr 20, 2026

    @ajbozarth
    MemberAuthor

    @avinash2692 I just posted an updated status from Claude, but I'm unsure if the remaining items are actionable or if just want to close this as fixed with what we have since the core issue was already addressed

  6. added this to the Release 0.5.0 milestone on Apr 20, 2026
  7. avinash2692 commented on Apr 21, 2026

    @avinash2692
    Contributor

    @ajbozarth : I think this should be solved in the current version of the file.

    When reusing an existing server, verify it is responsive with a lightweight check (e.g. ollama ps) before proceeding to warmups

    This is being done using a curl to /api/tags to get a quick health check of the server before the tests run. The timeout during the warmup is just a warning cause --max-time there is set to 120 for now (just to avoid hangups). This might slowdown the first pytest but the pytest timeout is set to a higher number (800 I think) so we should be good with the warmup happening there.

    Happy to close this and mark this as fixed. We can revisit if some edge case was looked over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions