Skip to content

test: add bootstrap flood regression test for PR #280#317

Merged
jalehman merged 1 commit into
Martian-Engineering:mainfrom
liu51115:test/bootstrap-flood-regression
Apr 7, 2026
Merged

test: add bootstrap flood regression test for PR #280#317
jalehman merged 1 commit into
Martian-Engineering:mainfrom
liu51115:test/bootstrap-flood-regression

Conversation

@liu51115

@liu51115 liu51115 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Adds regression test covering both fixes from PR #280 (bootstrap flood prevention):

  1. Checkpoint update after maintain() — verifies that maintain() updates the bootstrap checkpoint after rewriteTranscriptEntries(), so the next bootstrap() doesn't re-import everything due to stale mtime/size.

  2. Import cap — verifies that when the checkpoint IS stale, the import cap (>max(existingDbCount*0.2, 50)) blocks mass re-imports instead of flooding the DB.

  3. Defense-in-depth — both fixes working together in a round-trip scenario with repeated message patterns (the kind that confuse content-based anchoring).

All 3 tests pass. 598/598 total on upstream/main.

Related: #276, #280



Regression test covering both fixes from PR Martian-Engineering#280:
1. maintain() updates checkpoint after rewriteTranscriptEntries() — prevents stale checkpoint on restart
2. Import cap blocks mass re-imports when checkpoint is stale (>max(existingDbCount*0.2, 50))

Tests:
- Round-trip: create conv → maintain() → bootstrap() → assert 0 re-imports
- Import cap: corrupt checkpoint → append flood messages → assert cap blocks
- Defense-in-depth: both fixes working together
@jalehman

jalehman commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Thank you!

@jalehman jalehman merged commit 8b0d540 into Martian-Engineering:main Apr 7, 2026
1 check passed
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.

2 participants