Skip to content

test(cold-store-reaper): template-home fixture — suite 87.2s → 10.9s (#1435) - #3254

Merged
dezren39 merged 1 commit into
mainfrom
queue/1492-1435-template-home-fixture
Nov 1, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/1492-1435-template-home-fixture

Conversation

@dezren39

@dezren39 dezren39 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

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).

  • Template home (the cold-store-reaper(test): suite takes 162s for 80 tests — every test pays ~1.5s of fresh-manifest schema creation in setUp #1435 fix as specified): one template home is built per process with a real ColdStore.init() (template_home()), and ColdStoreTestBase.setUp copytrees it into the test's own temp dir. The manifest schema executescript now happens once per run instead of per test, while each test still gets an isolated home it can mutate freely. init() still runs in setUp and 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.
  • TestDrillCompare live-DB schema template: the in-memory live DB's schema is built once per class and backup()-copied per test, instead of a full executescript in every setUp.

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)

result
Before (main 8f24c7db5) 104 tests in 87.192s, OK (skipped=1)
After (this branch, run 1) 104 tests in 10.875s, OK (skipped=1)
After (run 2) 104 tests in 10.492s, OK (skipped=1)

~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.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

… 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.
@dezren39
dezren39 requested a review from a team as a code owner October 31, 2026 23:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T00:35:38.606085Z 0912245 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8d43075a-cf46-408a-b5ce-3ecfa8c3a511
Commits

Reviewing files that changed from the base of the PR and between f4f800e and 0912245.

Files selected for processing: 1
  • pkgs/cold-store-reaper/tests/test_cold_store.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39

dezren39 commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 0912245925

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@dezren39
dezren39 merged commit 7abf085 into main Nov 1, 2026
3 checks passed
@dezren39
dezren39 deleted the queue/1492-1435-template-home-fixture branch November 1, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cold-store-reaper(test): suite takes 162s for 80 tests — every test pays ~1.5s of fresh-manifest schema creation in setUp

1 participant