Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205: PackfileMaintenanceStepTests: fix flaky tests
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: 1. The duplicates reduce the total expected size below the batch size. 2. 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>
- Loading branch information