feat: enable SQLite WAL mode for all databases (AGI ticket #1) (#153)

This commit is contained in:
Alexander Whitestone
2026-03-08 16:07:02 -04:00
committed by GitHub
parent 11ba21418a
commit 82fb2417e3
31 changed files with 1042 additions and 170 deletions

View File

@@ -473,3 +473,40 @@ class TestSparkRoutes:
def test_spark_insights(self, client):
resp = client.get("/spark/insights")
assert resp.status_code == 200
# ── WAL Mode ──────────────────────────────────────────────────────────────
class TestWALMode:
"""Verify SQLite WAL mode is enabled for all Spark databases."""
def test_spark_memory_uses_wal(self):
from spark.memory import _get_conn
conn = _get_conn()
try:
mode = conn.execute("PRAGMA journal_mode").fetchone()[0]
assert mode == "wal", f"Expected WAL mode, got {mode}"
finally:
conn.close()
def test_spark_eidos_uses_wal(self):
from spark.eidos import _get_conn
conn = _get_conn()
try:
mode = conn.execute("PRAGMA journal_mode").fetchone()[0]
assert mode == "wal", f"Expected WAL mode, got {mode}"
finally:
conn.close()
def test_spark_memory_busy_timeout(self):
from spark.memory import _get_conn
conn = _get_conn()
try:
timeout = conn.execute("PRAGMA busy_timeout").fetchone()[0]
assert timeout == 5000
finally:
conn.close()