Repository navigation
test: probe the write lock from one request at a time - #267
Merged
Merged
Conversation
TestModelCheckRunsWithTheWriteLockReleased asks, from inside each probe, whether writeMu can be taken, by taking it for an instant. The protocols are probed concurrently, so one probe's own attempt was sometimes what another probe found held, and the test reported the lock as held during the check when it was not. Under -race it failed 17 times in 300 runs before this change and none in 1000 after. It has failed on main and on an unrelated pull request. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
TestModelCheckRunsWithTheWriteLockReleasedfails intermittently. It failed onmainat50e6a5cand on an unrelated pull request, #266.The test asks, from inside each provider probe, whether
writeMucan be taken, by taking it for an instant withTryLock. The protocols are probed concurrently, so one probe's own attempt was sometimes what another probe found held. The test then reported the lock as held during the check when it was not.The probes in the test now make that attempt one at a time. Only the test changes; the code under test is not at fault and is untouched.
Checked
go test -race, the test failed 17 times in 300 runs before this change and 0 times in 1000 runs after.go vet ./internal/app/Not checked
go test ./...was not rerun locally for this one-file test change; CI runs it.Test plan
go test -race -run TestModelCheckRunsWithTheWriteLockReleased -count=1000 ./internal/app/🤖 Generated with Claude Code