PackfileMaintenanceStepTests: fix flaky tests #205
Merged
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.
The PackfileMaintenanceStepTests have been failing periodically, and
mostly with failures in RepackAllToOnePack() leading to a failure in
ExpireAllButOneAndKeep().
The way we "force" Git to repack all is to provide a custom batch size.
This batch size used to mean "repack all pack-files with size at most
X until reaching a size of at least X". By specifying "total size - 1",
this required repacking all objects.
HOWEVER, the new logic actually computes an "expected" size of the
objects in a pack that are referenced by the multi-pack-index. If we
have duplicate objects, then those objects can cause two types of error:
The duplicates reduce the total expected size below the batch size.
The computation of "total expected size" causes round-off error.
Both types of error under-count the number of bytes in the final
pack-file.
By changing the batch size to "total size - min size + 1" we ensure the
following:
I. The batch size is larger than the maximum pack size.
II. Every pack-file is required to reach the batch size.
III. We have minimized the chance that duplicate objects will drop
below this threshold.
With the use of gvfs-helper, we have less control over the pack-files
that are downloaded as part of the clone operation. At minimum, with
this change we should be in a better state than before.
Signed-off-by: Derrick Stolee dstolee@microsoft.com