Repository navigation
test(cold-store-reaper): template-home fixture — suite 87.2s → 10.9s (#1435) - #3254
Conversation
… 87.2s -> 10.9s (#1435) ColdStoreTestBase paid a fresh ColdStore init (full manifest schema executescript) in every setUp, and every fake-server tearDown paid serve_forever's default 0.5s shutdown poll. Measured on the laptop: fresh init ~0.48s ea, server shutdown ~0.50s ea, template copy + revalidating init ~0.001s ea. Fix (test fixtures only, no production change, no test weakened or removed): build one template home per process via a real ColdStore.init() and copytree it per test (each test still gets an isolated, freely mutable home; init() still runs and revalidates); serve all per-test fake servers via serve_fast() with poll_interval=0.05; TestDrillCompare builds its in-memory live-DB schema once per class and backup-copies it per test. Migration tests (pre-v3 ledger trash, pre-v4 objects evicted) build their own genuinely fresh legacy homes and are untouched, as is the first-run init path itself. Before/after (laptop, python3 -m unittest discover -s pkgs/cold-store-reaper/tests): before 104 tests in 87.192s OK (skipped=1); after 104 tests in 10.875s / 10.492s OK (skipped=1) — ~8x. Queue task 1492.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #1435 · queue task 1492
What
Test-fixture-only change to
pkgs/cold-store-reaper/tests/test_cold_store.py. No production code changes; no test weakened, skipped, or deleted (104 tests before and after, same 1 pre-existing skip).ColdStore.init()(template_home()), andColdStoreTestBase.setUpcopytrees it into the test's own temp dir. The manifest schemaexecutescriptnow happens once per run instead of per test, while each test still gets an isolated home it can mutate freely.init()still runs insetUpand revalidates the copied home (cheap no-op once the manifest exists).serve_fast()for every per-test fake server (Drive, S3, D1 ×3, Turso):serve_forever(poll_interval=0.05)instead of the 0.5s default. Component measurements on the laptop showed the default shutdown poll cost ~0.50s per server teardown — the same order as the schema cost — so the template home alone landed ~2×, short of this issue's ≥5× acceptance bar. Serving behavior is unchanged; only shutdown latency drops.TestDrillComparelive-DB schema template: the in-memory live DB's schema is built once per class andbackup()-copied per test, instead of a fullexecutescriptin everysetUp.Untouched, by design: the migration tests (
TestObjectsEvictedMigration,TestLedgerTrashMigration) still build genuinely fresh legacy homes, and the first-run schema-creation path itself is still exercised (it builds the template).Measurements (laptop,
python3 -m unittest discover -s pkgs/cold-store-reaper/tests)8f24c7db5)~8× — past the ≥5× acceptance bar. Component timings: fresh
ColdStore.init()~0.48s ea; template copy + revalidating init ~0.001s ea; default-poll server cycle ~0.50s ea vs ~0.05s at poll_interval=0.05.Refs: triage task 1438 (confirmed the per-test schema cost), queue task 1492.
Need help on this PR? Tag
@codesmith-botwith what you need.