fix(vmcp): make the version poll interval per-Server, not a global - #6644
Open
aron-muon wants to merge 2 commits into
Open
fix(vmcp): make the version poll interval per-Server, not a global#6644aron-muon wants to merge 2 commits into
aron-muon wants to merge 2 commits into
Conversation
aron-muon
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
jerm-dro,
jhrozek and
tgrunnagle
as code owners
September 11, 2026 09:12
Open
5 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6644 +/- ##
==========================================
- Coverage 78.98% 78.92% -0.06%
==========================================
Files 782 782
Lines 78065 78068 +3
==========================================
- Hits 61658 61617 -41
- Misses 16402 16446 +44
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
hmm I guess the lint issue should be fixed seprately? We recently merged a whole bunch of dep and toolchain bumps, those are likely to have introduced new linter findings |
aron-muon
force-pushed
the
fix/vmcp-server-versionpollinterval-race
branch
from
September 11, 2026 09:57
c4e40c2 to
888e409
Compare
TestPeriodicStatusReporting_ReactsToVersionChange assigned the package-level versionPollInterval while marked t.Parallel. Server.Start reads it for reconcileSessionsOnRegistryChange (stacklok#6549) and periodicStatusReporting reads it for its ticker, so it raced any parallel test that starts a server - TestReadinessEndpoint_DynamicMode_CacheNotSynced in practice - and the detector took several unrelated tests in the package down with it. Move the override onto Server and read it through s.pollInterval(), leaving a package-level default. The test now sets it on its own Server and stays parallel. This is what session_reconcile.go's doc comment already asks for: the interval "passed in ... so tests can drive it without mutating shared state that a parallel test also touches". Start was still handing it the global. Dropping t.Parallel would also have fixed the race but trips paralleltest, and would have left the global mutable for the next test to trip over.
aron-muon
force-pushed
the
fix/vmcp-server-versionpollinterval-race
branch
from
September 11, 2026 10:04
888e409 to
96122ef
Compare
Contributor
Author
|
Reworked after CI caught that dropping |
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.
Summary
Testsis red onmainunder-race:TestPeriodicStatusReporting_ReactsToVersionChangeshortens the ticker by assigning the package-levelversionPollInterval, restoring it int.Cleanup, but it'st.Parallel().Server.Startreads that same variable when wiringreconcileSessionsOnRegistryChange(#6549), andperiodicStatusReportingreads it for its own ticker, so any parallel test that starts a server races it. The detector fails the whole binary, so unrelated tests go red with it -TestListChangedSink_EndToEnd_*,TestAuthzCallGate,TestServeHandlerMetricsOnTransportPort.This PR moves the override onto
Serverand reads it throughs.pollInterval(), keeping a package-level default. The test sets it on its ownServerand stays parallel.That's what
session_reconcile.go's doc comment already asks for - the interval "passed in ... so tests can drive it without mutating shared state that a parallel test also touches" -Startwas just still handing it the global.I first tried simply dropping
t.Parallel(). It fixes the race but tripsparalleltest, and leaves the global mutable for the next test to trip over, so this seemed the better shape.Type of change
Test plan
task test)task lint-fix)Reproduced on a pristine
mainat 7e52ab9, deterministic over repeated runs:With this change that filter is exit 0 over 3 runs,
go test -race ./pkg/vmcp/server/...passes, andgolangci-lint run ./pkg/vmcp/...is 0 issues (includingparalleltest).Does this introduce a user-facing change?
No.