Skip to content

test: make SQLite cross-context lock regression deterministic - #1074

Merged
intel352 merged 1 commit into
mainfrom
fix/sqlite-context-lock-regression-20261016
Oct 16, 2026
Merged

intel352 merged 1 commit into
mainfrom
fix/sqlite-context-lock-regression-20261016

Conversation

@intel352

Copy link
Copy Markdown
Contributor

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. Commit 8ad061ef9e364630ed115261320a7b01b595102f, tree ec83db566fa4421f7f16ce777f61a29a69699405. PR#1022 remains separate and its original failed CI is retained. No deployment is part of this fix.

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.
@intel352
intel352 merged commit 270761a into main Oct 16, 2026
27 of 28 checks passed
@intel352
intel352 deleted the fix/sqlite-context-lock-regression-20261016 branch October 16, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant