perf: keep planning reads available during writes (Closes #699)
This commit is contained in:
1 parent
46c75f0b22
commit
1de6d73e75
4 files changed
+51
-4
No files matched your search
@@ -65,6 +65,23 @@ def test_deferrals_are_durable_revisioned_idempotent_and_account_scoped(tmp_path
|
||||
) == {"revision": 2, "records": {}}
|
||||
|
||||
|
||||
def test_initialized_later_reads_remain_available_during_a_planning_write(tmp_path):
|
||||
path = tmp_path / "later.sqlite3"
|
||||
store = LaterStore(path, timeout=0.05)
|
||||
expected = store.apply(
|
||||
"timmy", "seed", "defer", "issue:r:1:",
|
||||
wake_at="2026-08-10T09:00:00.000Z",
|
||||
)
|
||||
|
||||
writer = sqlite3.connect(path)
|
||||
writer.execute("BEGIN IMMEDIATE")
|
||||
try:
|
||||
assert LaterStore(path, timeout=0.05).get("timmy") == expected
|
||||
finally:
|
||||
writer.rollback()
|
||||
writer.close()
|
||||
|
||||
|
||||
def test_batch_applies_in_one_ordered_idempotent_unit(tmp_path):
|
||||
store = LaterStore(tmp_path / "later.sqlite3")
|
||||
operations = [
|
||||
|
||||
@@ -67,6 +67,20 @@ def test_operations_are_durable_ordered_idempotent_and_account_scoped(tmp_path):
|
||||
}
|
||||
|
||||
|
||||
def test_initialized_today_reads_remain_available_during_a_planning_write(tmp_path):
|
||||
path = tmp_path / "today.sqlite3"
|
||||
store = TodayStore(path, timeout=0.05)
|
||||
expected = store.apply("timmy", "seed", "add", "issue:r:1:")
|
||||
|
||||
writer = sqlite3.connect(path)
|
||||
writer.execute("BEGIN IMMEDIATE")
|
||||
try:
|
||||
assert TodayStore(path, timeout=0.05).get("timmy") == expected
|
||||
finally:
|
||||
writer.rollback()
|
||||
writer.close()
|
||||
|
||||
|
||||
def test_capacity_and_estimates_are_durable_account_scoped_and_follow_item_identity(tmp_path):
|
||||
path = tmp_path / "today.sqlite3"
|
||||
store = TodayStore(path, limit=3)
|
||||
|
||||
Reference in new issue
Block a user