Repository navigation
Description
Finding
The cold-store-reaper test suite takes 162 s for 80 tests, and the cost is not the tests — it is per-test setup: every test creates a fresh cold-store home, and creating the manifest schema costs ~1.3–1.7 s each time.
Verified this run (main 37418e56, sandbox VM):
python3 -m unittest discover -s pkgs/cold-store-reaper/tests→Ran 80 tests in 162.238s(OK, 1 skipped).- Per-test timing: slowest single test 6.2 s, only 13 of 80 under 2 s, test bodies near-instant (e.g.
test_auth_url_shapebody: 0.01 s; itssetUp: 1.51 s). - Isolation:
ColdStore(home).init()on a fresh home = 1.67 s; secondinit()on the same home = 0.01 s. cProfile of a freshinit(): 1.30 s total, of which 1.295 s is a single call —sqlite3.Connection.executescriptinsideColdStore.db()(cold_store.py:369), runningschema.sqlto create the manifest. - Every test class derives from
ColdStoreTestBase.setUp(tests/test_cold_store.py:232), which builds a brand-newTemporaryDirectoryhome and callsstore.init()— so the suite pays the fresh-schema cost ~80 times (plus stacked fake Drive/S3/D1 servers in subclasses). The turso-export and drill tests pay it again per test through their own fixtures.
The absolute executescript cost varies with filesystem fsync speed (this VM is slow; a fast CI disk will be quicker), but the structure — full schema creation per test instead of once per suite — dominates the runtime anywhere and grows linearly with the test count.
Why it matters
A 2–3 minute suite is a suite people stop running locally — which compounds #1427 (no CI runs these tests at all): the package's only safety net is both unwired and slow. It also slows every future CI wiring: a path-filtered workflow (per #1427) that takes ~3 minutes for one small package will pressure people to skip it. Backup-integrity code deserves a suite that runs in seconds.
Acceptance criteria
- The suite's wall-clock drops by at least ~5x on this VM (162 s → under ~35 s) with all 80 tests still passing and none deleted or weakened.
- Fresh-schema creation happens once per suite/run (e.g. a template manifest built once and copied per test, or an equivalent shared fixture), while each test still gets an isolated manifest it can mutate freely.
- Tests that specifically exercise first-run schema creation/migrations (fresh-home
init, pre-v4 manifest migration) keep a genuinely fresh home — they are the exception, not the default fixture. - The measurement is repeated and recorded on the PR (before/after wall-clock for the full discover run).
Activity
developing-today commentedon Oct 27, 2026
CODE-519
dezren39 commentedon Oct 27, 2026
Filed this run by the new-issue-creator (lane A). Measured on main
37418e56: full discover run 162.238s for 80 tests; per-test timing shows bodies near-instant and setUp dominant (test_auth_url_shape: setUp 1.51s, body 0.01s); cProfile of a freshColdStore.init()puts 1.295s of 1.30s in the singleexecutescriptcall inColdStore.db()(cold_store.py:369). Companion to #1427 (no CI runs the suite).dezren39 commentedon Oct 27, 2026
🤖 Agent note · picked up
18 remaining items
dezren39 commentedon Oct 31, 2026
🤖 Agent note · parked
python: unittest suitesSUCCESS;worker: local proofstill QUEUED after a 5-minute poll. Codex review run failed on Codex usage limits with zero finding threads (verified: no review comments on the PR), CodeRabbit rate-limited — no findings to disposition.worker: local proofis green, merge PR test(cold-store-reaper): template-home fixture — suite 87.2s → 10.9s (#1435) #3254 (issue closes), then complete task 1492 as fixed_merged. Laptop evidence: suite 87.192s → 10.875s/10.492s, 104 tests OK (skipped=1) both runs.dezren39 commentedon Nov 1, 2026
agent-note:v1
Merge pull request #3254 from developing-today/queue/1492-1435-templa…
dezren39 commentedon Nov 1, 2026
agent-note:v1