Repository navigation
test(drivers): synchronize control v2 Modbus test fake - #787
Merged
Merged
Conversation
frahlg
force-pushed
the
agent/fix-control-v2-test-race
branch
from
August 4, 2026 09:09
1aa6ec2 to
6dc2e86
Compare
frahlg
marked this pull request as ready for review
August 4, 2026 09:13
This was referenced Oct 17, 2026
frahlg
added a commit
that referenced
this pull request
Oct 17, 2026
* ci: run the Go race detector on the control-loop packages CI runs go test without -race. Agents report "race tests pass" from local runs, and two races still merged: #787 and #789 fixed test fakes that raced after landing. On their parent commits (ee416d1, 5d5f810) this check fails with WARNING: DATA RACE. .github/scripts/race.sh runs -race on the 16 package trees that share state with the control loop. The same command runs locally and in the new race job, which the required go test + vet check now waits for. All of them pass on master today. * ci: skip the wall-clock retention budget test under -race The race detector slows code 5-10x, so the 3-second retention budget in TestForecastRetentionLargeOverflowWithinScoringBudget failed on CI with no data race. The plain test job still enforces the budget. * ci: exercise race script edits in Core checks Signed-off-by: Fredrik Ahlgren <[email protected]> --------- Signed-off-by: Fredrik Ahlgren <[email protected]>
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
controlV2Modbustest double with anRWMutex.go/internal/drivers/control_v2_test.go; no changeset is needed for a test-only change.Root cause
TestControlV2RegistryExpiresLeaseIntoDefaultread the fake Modbus register map directly while the registry run loop could write it during lease expiry. The race is in the test harness, not production code: the registry serializes each driver's lifecycle, poll, command, and default work in one run loop, and the production Modbus capability serializes its calls independently.Validation
go test -race ./internal/drivers -run '^TestControlV2RegistryExpiresLeaseIntoDefault$' -count=5go test -race ./internal/drivers -run 'ControlV2' -count=3go test -race ./internal/drivers -count=1make verifymake verify-allvia the pre-push hook, including Linux arm64/amd64 and Windows amd64 buildsThe PR remains draft until normal repository review is complete.