You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Store commit-failure fakes raise inside the transaction body instead of at commit #1559
Two tests that claim to cover a failed store commit raise OSError("commit failed") inside the transaction body (deva4357f9a):
test_failed_atomic_control_commit_exposes_no_partial_transition (implementations/python/tests/test_run_310_supervisory_lifecycle.py:847-876) wraps _upsert_record and raises at :872. record_participant_control claims a running record (raes_runtime/participant_control_mediation.py:112) before it calls _commit_control_transition (:115), so the first _upsert_record call is the claim, and the test never reaches the atomic control commit it names.
test_local_control_plane_store_rolls_back_snapshot_transaction_failure (implementations/python/tests/test_runtime_control_plane_api.py:1864-1887) wraps _upsert_snapshot and raises at :1878. It saves an empty RuntimeSnapshot(), which equals the default snapshot, so even a committed write would pass.
An error raised in the body takes the rollback branch of transaction() (raes_runtime/control_plane_store_local_codec.py:13-24). A real commit failure is a sqlite3 error raised by commit(): transaction() re-raises it without a rollback, and _connection() (raes_runtime/control_plane_store_local.py:357-362) closes the connection, which discards the open transaction. The audit observed this on SQLite 3.50.4 with a deferred foreign key: commit() raised sqlite3.IntegrityError, and nothing persisted after close().
The #1344 fixture-provenance audit lists this as finding ST-2, open, in the record #1461 proposes. The fix changes only tests, and #1472 proposes it.
Scope
Make both fakes fail at SQLite's own COMMIT (for example through a deferred foreign-key violation in the open transaction) after the writes each test names, and assert on state that a committed write would change.
Done when
Both tests fail if the store commits the transaction, and pass on dev.
Activity
docs(research): cite the issue or pull request that tracks each regis…