Repository navigation
test: make SQLite cross-context lock regression deterministic - #1074
Merged
Merged
Conversation
Assert the operation mutex is released before a lock handle returns, then acquire and release a real second context while retaining the first. Verify the first context still reports its typed lock conflict. Remove the scheduler-dependent 100ms guard without changing production locking, dependencies, or functional deadlines. The historical mutex lifetime defect fails directly; 160 shuffled race executions pass.
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.
The cross-context SQLite lock regression fails intermittently in parallel CI because it gives a goroutine and real SQLite I/O only100ms. The production invariant is that a returned advisory lock handle has released the store operation mutex.
Check that invariant directly before acquiring and releasing a real second context, then confirm the first context still returns its typed lock conflict. This retains real database behavior and catches the historical mutex-lifetime defect without depending on scheduler speed.
Validation: the old-defect overlay fails the new assertion directly in0.03s;16 SQLite parent tests pass10 shuffled race iterations (160PASS). Focused vet and official golangci-lint2.14 pass. Two independent scope/code reviews pass with no findings. The actual configured pre-commit hook passes. Local checks used the existing source checkout with identical SQLite files; this PR's actual main-based CI remains required.
Exactly one test file changes on base
3c5aa969b6650ed4758084a886061da97d15500c; production, dependencies and functional timeouts are unchanged. Commit8ad061ef9e364630ed115261320a7b01b595102f, treeec83db566fa4421f7f16ce777f61a29a69699405. PR#1022 remains separate and its original failed CI is retained. No deployment is part of this fix.