[PR #14865] integration: allow env overrides for slow runners #25422

Open
opened 2026-04-19 18:12:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14865
Author: @oldeucryptoboi
Created: 3/15/2026
Status: 🔄 Open

Base: mainHead: laurent/integration-test-env-overrides


📝 Commits (1)

  • 5bdb6ef integration: allow env overrides for slow runners

📊 Changes

3 files changed (+75 additions, -7 deletions)

View changed files

📝 integration/api_test.go (+8 -6)
📝 integration/basic_test.go (+1 -1)
📝 integration/utils_test.go (+66 -0)

📄 Description

Summary

This makes the integration test harness configurable via environment variables so the opt-in tests can run on slower systems without changing the default behavior for normal runs.

It adds support for overriding:

  • request context timeout
  • initial no-token timeout
  • streaming stall timeout
  • runner options such as num_ctx, num_batch, and num_predict

Defaults remain unchanged when the new env vars are not set.

Why

The current integration helpers bake in fixed time budgets and runner settings. That works for many local runs, but it makes the opt-in integration suite difficult to use on slower GPU stacks where the tests are still making progress and eventually succeed.

This keeps the default expectations intact while giving local runners a supported escape hatch.

New env vars

  • OLLAMA_TEST_CONTEXT_TIMEOUT
  • OLLAMA_TEST_INITIAL_TIMEOUT
  • OLLAMA_TEST_STREAM_TIMEOUT
  • OLLAMA_TEST_NUM_CTX
  • OLLAMA_TEST_NUM_BATCH
  • OLLAMA_TEST_NUM_PREDICT

Testing

Passed locally:

go test ./...
GOEXPERIMENT=synctest go test ./...

Also passed locally with the new overrides enabled against an existing local server:

OLLAMA_TEST_EXISTING=1 \
OLLAMA_HOST=127.0.0.1:11443 \
OLLAMA_TEST_DEFAULT_MODEL=qwen25-0.5b-local:latest \
OLLAMA_TEST_NUM_CTX=4096 \
OLLAMA_TEST_NUM_PREDICT=16 \
OLLAMA_TEST_INITIAL_TIMEOUT=120s \
OLLAMA_TEST_STREAM_TIMEOUT=120s \
OLLAMA_TEST_CONTEXT_TIMEOUT=5m \
go test -tags=integration ./integration \
  -run '^(TestBlueSky|TestAPIGenerate|TestAPIChat)$' \
  -count=1 -timeout 20m -v

On this WSL2 Vulkan setup, that completed successfully with:

  • TestAPIGenerate: 129.54s
  • TestAPIChat: 107.85s
  • TestBlueSky: 55.90s

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14865 **Author:** [@oldeucryptoboi](https://github.com/oldeucryptoboi) **Created:** 3/15/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `laurent/integration-test-env-overrides` --- ### 📝 Commits (1) - [`5bdb6ef`](https://github.com/ollama/ollama/commit/5bdb6ef210dc34236119b5e4049d7faf1c80679c) integration: allow env overrides for slow runners ### 📊 Changes **3 files changed** (+75 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `integration/api_test.go` (+8 -6) 📝 `integration/basic_test.go` (+1 -1) 📝 `integration/utils_test.go` (+66 -0) </details> ### 📄 Description ## Summary This makes the integration test harness configurable via environment variables so the opt-in tests can run on slower systems without changing the default behavior for normal runs. It adds support for overriding: - request context timeout - initial no-token timeout - streaming stall timeout - runner options such as `num_ctx`, `num_batch`, and `num_predict` Defaults remain unchanged when the new env vars are not set. ## Why The current integration helpers bake in fixed time budgets and runner settings. That works for many local runs, but it makes the opt-in integration suite difficult to use on slower GPU stacks where the tests are still making progress and eventually succeed. This keeps the default expectations intact while giving local runners a supported escape hatch. ## New env vars - `OLLAMA_TEST_CONTEXT_TIMEOUT` - `OLLAMA_TEST_INITIAL_TIMEOUT` - `OLLAMA_TEST_STREAM_TIMEOUT` - `OLLAMA_TEST_NUM_CTX` - `OLLAMA_TEST_NUM_BATCH` - `OLLAMA_TEST_NUM_PREDICT` ## Testing Passed locally: ```bash go test ./... GOEXPERIMENT=synctest go test ./... ``` Also passed locally with the new overrides enabled against an existing local server: ```bash OLLAMA_TEST_EXISTING=1 \ OLLAMA_HOST=127.0.0.1:11443 \ OLLAMA_TEST_DEFAULT_MODEL=qwen25-0.5b-local:latest \ OLLAMA_TEST_NUM_CTX=4096 \ OLLAMA_TEST_NUM_PREDICT=16 \ OLLAMA_TEST_INITIAL_TIMEOUT=120s \ OLLAMA_TEST_STREAM_TIMEOUT=120s \ OLLAMA_TEST_CONTEXT_TIMEOUT=5m \ go test -tags=integration ./integration \ -run '^(TestBlueSky|TestAPIGenerate|TestAPIChat)$' \ -count=1 -timeout 20m -v ``` On this WSL2 Vulkan setup, that completed successfully with: - `TestAPIGenerate`: `129.54s` - `TestAPIChat`: `107.85s` - `TestBlueSky`: `55.90s` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 18:12:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#25422