Repository navigation
test(backup): guard prune and create growth on long histories - #309
Merged
Merged
Conversation
Backup tests stopped short of histories that exposed repeated attachment list decoding and unbounded segment growth. Allocation bounds let CI catch those regressions without depending on runner timing. Keep the live attachment count equal for incremental create so its comparison measures history length. Prune retains growing attachment sets to cover the reference walks that caused the earlier regression.
Future changes need to preserve the intended measurements when adapting these checks. Document why prune exceeds linear growth and which repository state incremental create inherits from the preceding check.
The incremental create check should measure its own history without inheriting repository changes from prune. Independent fixtures make that contract clear and avoid extra cache state in the test, at the cost of building the large history twice.
Changing the large history must also change the small history's base attachment count. Share that size so future adjustments keep the live attachment totals equal and measure history growth alone.
roborev: Combined Review (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backup tests now fail if prune or incremental create allocations grow too quickly as snapshot history gets longer. Each check builds histories of 100 and 1,000 incremental snapshots, with one new attachment per snapshot, and compares allocations between the two sizes. For create, the 100-snapshot history starts from a base snapshot of 900 attachments, so both sizes hold equal attachment counts.
On the code before the list segment growth fixes, prune allocates 173x more at 1,000 snapshots than at 100. With the fixes, the ratio drops to 33x, an 81% cut. Memoization alone leaves prune at 69x, so the prune check catches a regression in segment compaction as well as in memoization.
Prune visits each snapshot's growing attachment set, about N²/2 refs in total, so its bound allows a 1.5x margin over the measured 33x. Create runs against histories with equal live attachment counts, so its growth should stay flat. Its bound allows 2x.