Skip to content

TestLocalAdoptionSavesAndReloadsEligibleModel flakes under the race detector: its probe uses the 400ms default timeout #1132

Closed

Description

@Vasanthdev2004

Version / branch / commit

Seen on #886 at 433653b8, which has main at 4dc603f6 merged in. It failed in the Race Detector job on the first attempt, and a re-run of the same commit passed.

What happened

--- FAIL: TestLocalAdoptionSavesAndReloadsEligibleModel (0.74s)
    provider_adoption_test.go:57: expected one detected runtime: []

Cause

The test calls provideronboarding.DetectLocalRuntimes against its own httptest server without setting Timeout, so the probe gets defaultLocalProbeTimeout, which is 400ms. probeLocalRuntime treats a timeout as "not running" and drops the candidate without an error, so one slow loopback round trip under -race on a busy runner becomes an empty result. The run took 0.74s, which fits a probe that hit the deadline. Nothing in #886 touches this path, and the test is about adoption rather than probe timing.

I couldn't reproduce it locally. Ten runs under -race, and twenty more with every core busy, all passed on a 20-core Windows machine.

Fix

Pass a test-sized Timeout of a few seconds in the test's LocalDetectOptions. The production default stays at 400ms.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingissue-approvedReviewed and approved by the core team; community PRs may implement this issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions