tests/kernel/test_video_import_concurrency.py covers concurrent appends thoroughly: disjoint ordinals, one ordinal with the same bytes (a retry), and one ordinal with different bytes (a conflict).
It covers no race on the terminal transitions. Neither of these has a test:
- two
commit calls arriving together on one session
- a
commit and an abort arriving together
commit is written to be idempotent by state (COMMITTED returns the batch it already made) and abort refuses a committed session, so the intended answers are defined. What is unverified is what the store does when both transactions reach the session row at once: the SQLite metadata store sets foreign_keys and busy_timeout but does not begin immediate, so two writers take a deferred read snapshot and the second upgrade can fail rather than wait.
The concern is the answer a caller receives - a 500 where the contract promises an idempotent result or a typed refusal - rather than the stored state, which reaches the same place either way.
tests/kernel/test_video_import_concurrency.pycovers concurrent appends thoroughly: disjoint ordinals, one ordinal with the same bytes (a retry), and one ordinal with different bytes (a conflict).It covers no race on the terminal transitions. Neither of these has a test:
commitcalls arriving together on one sessioncommitand anabortarriving togethercommitis written to be idempotent by state (COMMITTEDreturns the batch it already made) andabortrefuses a committed session, so the intended answers are defined. What is unverified is what the store does when both transactions reach the session row at once: the SQLite metadata store setsforeign_keysandbusy_timeoutbut does not begin immediate, so two writers take a deferred read snapshot and the second upgrade can fail rather than wait.The concern is the answer a caller receives - a 500 where the contract promises an idempotent result or a typed refusal - rather than the stored state, which reaches the same place either way.