[GH-ISSUE #12963] Data Race Conditions in Scheduler Tests #70653

Open
opened 2026-05-04 22:23:27 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @vincentkoc on GitHub (Nov 5, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12963

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

The scheduler tests in server/sched_test.go contain data race conditions that cause intermittent test failures, particularly on Windows CI runners.

How to Reproduce

Method 1: Using Race Detector (Reliable)

go test -race -count=1 ./server

Method 2: Multiple Runs (Exposes Flakiness)

go test -race -count=5 ./server

Method 3: Specific Test Cases

go test -race ./server -run "TestSchedRequestsSimpleReloadSameModel|TestSchedRequestsMultipleLoadedModels"

Expected Behavior

Tests should pass consistently without data race warnings.

Actual Behavior

Tests fail with data race warnings:

WARNING: DATA RACE
Write at 0x00c00047dda0 by goroutine 18:
  github.com/ollama/ollama/server.TestSchedRequestsSimpleReloadSameModel()
      /path/to/ollama/server/sched_test.go:254 +0x864
  github.com/ollama/ollama/server.newScenarioRequest()
      /path/to/ollama/server/sched_test.go:119 +0x90c

Previous read at 0x00c00047dda0 by goroutine [...]

WARNING: DATA RACE
Read at 0x00c000614670 by goroutine 43:
  github.com/ollama/ollama/server.(*Scheduler).processPending()
      /path/to/ollama/server/sched.go:177 +0x404
  github.com/ollama/ollama/server.(*Scheduler).Run.func1()
      /path/to/ollama/server/sched.go:122 +0x40

Relevant log output


OS

Windows

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @vincentkoc on GitHub (Nov 5, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12963 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? The scheduler tests in `server/sched_test.go` contain data race conditions that cause intermittent test failures, particularly on Windows CI runners. ## How to Reproduce ### Method 1: Using Race Detector (Reliable) ```bash go test -race -count=1 ./server ``` ### Method 2: Multiple Runs (Exposes Flakiness) ```bash go test -race -count=5 ./server ``` ### Method 3: Specific Test Cases ```bash go test -race ./server -run "TestSchedRequestsSimpleReloadSameModel|TestSchedRequestsMultipleLoadedModels" ``` ## Expected Behavior Tests should pass consistently without data race warnings. ## Actual Behavior Tests fail with data race warnings: ``` WARNING: DATA RACE Write at 0x00c00047dda0 by goroutine 18: github.com/ollama/ollama/server.TestSchedRequestsSimpleReloadSameModel() /path/to/ollama/server/sched_test.go:254 +0x864 github.com/ollama/ollama/server.newScenarioRequest() /path/to/ollama/server/sched_test.go:119 +0x90c Previous read at 0x00c00047dda0 by goroutine [...] WARNING: DATA RACE Read at 0x00c000614670 by goroutine 43: github.com/ollama/ollama/server.(*Scheduler).processPending() /path/to/ollama/server/sched.go:177 +0x404 github.com/ollama/ollama/server.(*Scheduler).Run.func1() /path/to/ollama/server/sched.go:122 +0x40 ``` ### Relevant log output ```shell ``` ### OS Windows ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-04 22:23:27 -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#70653