Skip to content

Conversation

@dmjb
Copy link
Member

@dmjb dmjb commented Jan 9, 2026

Root Cause: The NewBackendWatcher() function was calling ctrl.SetLogger() on every invocation at line 109 in manager.go. Since tests run in parallel (using t.Parallel()), multiple goroutines were concurrently setting the global controller-runtime logger, causing a data race.

Solution: Used sync.Once to ensure the controller-runtime logger is set exactly once across all invocations, even when multiple BackendWatcher instances are created concurrently.

Root Cause: The NewBackendWatcher() function was calling ctrl.SetLogger() on every invocation at line 109 in manager.go. Since tests run in parallel (using t.Parallel()), multiple goroutines were concurrently setting the global controller-runtime logger, causing a data race.

Solution: Used sync.Once to ensure the controller-runtime logger is set exactly once across all invocations, even when multiple BackendWatcher instances are created concurrently.
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Jan 9, 2026
@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.99%. Comparing base (a31891d) to head (b4719f3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3239   +/-   ##
=======================================
  Coverage   56.98%   56.99%           
=======================================
  Files         350      350           
  Lines       34938    34940    +2     
=======================================
+ Hits        19909    19913    +4     
+ Misses      13369    13367    -2     
  Partials     1660     1660           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmjb dmjb merged commit 47634b1 into main Jan 9, 2026
33 checks passed
@dmjb dmjb deleted the fix-vmcp-race branch January 9, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants