Repository navigation
TEST: Make score observation contention checks deterministic - #3255
Merged
Richard Lundeen (richlundeen) merged 2 commits intoOct 16, 2026
Conversation
Assert SQLITE_BUSY while the holder transaction is open, then verify both post-commit outcomes without a scheduler-dependent busy wait. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fe8ae25e-f344-41f5-88b3-679c29f3a498
varunj-msft
approved these changes
Oct 16, 2026
Richard Lundeen (richlundeen)
enabled auto-merge
October 16, 2026 21:40
Assert that a competing SQLITE_BUSY attempt cannot reach observation validation before acquiring its write lock. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fe8ae25e-f344-41f5-88b3-679c29f3a498
Richard Lundeen (richlundeen)
deleted the
richlundeen-score-observation-test-reliability
branch
October 16, 2026 22:41
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.
Description
Make the score-observation insert/delete contention test independent of the time needed to commit the holder transaction.
The Windows Python 3.13 dev job for #3195 failed in
[True-False]withsqlite3.OperationalError: database is lockedat the competingBEGIN IMMEDIATE. The test call took 25.23 seconds. The event used by the test fires before SQLite attempts to acquire the lock. It does not guarantee that the holder can commit before SQLite's busy timeout expires. The log does not establish the exact cause of that delay.A local probe reproduced the same error by holding the first transaction open until the competing write returned
SQLITE_BUSY. The probe used a 1 ms busy timeout to avoid a slow reproduction.The revised test:
busy_timeout=0on competing connections and requires the exactSQLITE_BUSYerror atBEGIN IMMEDIATE. Other database errors still fail the test.This is a test-only change. It does not add production retries, change production timeouts, or change memory responsibilities. It is independent of the analytics changes in #3195.
Tests and Documentation
Local validation used Windows and uv-managed Python 3.14.2:
uv sync --frozen --extra all: passed;uv.lockis unchanged.uv run --no-sync pytest tests\unit\memory\memory_interface\test_interface_observations.py -q --tb=short: passed, 48 tests.uv run --no-sync pytest tests\unit\memory\memory_interface\test_interface_observations.py -k concurrent_insert_and_final_delete -q --tb=short: passed in 10 separate runs, 40 cases total.uv run --no-sync pre-commit run --all-files: passed, all hooks. The first run formatted the new assertion; the second run passed without changes.No public behavior or documentation changed. JupyText execution and the full unit suite were not run.