[PATCH v2 6/9] t7900: clean up large EXPENSIVE repository
From: Patrick Steinhardt <hidden>
Date: 2026-07-03 09:24:32
Subsystem:
the rest · Maintainer:
Linus Torvalds
One of the tests in t7900 is marked with EXPENSIVE because we create a repository with 2GB of data that we end up repacking. We never clean up that repository though, so we occupy the full 2GB of data until the end of the test suite. Besides clogging our disk, having an EXPENSIVE test that alters the repository's state used by subsequent tests is also a bad idea, as it can easily have an impact on the heuristics used by other maintenance tasks. Adapt the test so that we create the data in a standalone repository that we clean up at the end of the test. While at it, also disable auto-maintenance so that it does not race with our manual maintenance. Signed-off-by: Patrick Steinhardt <redacted> --- t/t7900-maintenance.sh | 56 ++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 25 deletions(-)
diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index d7f82e1bec..8a7e1306d0 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh@@ -461,36 +461,42 @@ test_expect_success 'incremental-repack task' ' ' test_expect_success EXPENSIVE 'incremental-repack 2g limit' ' - test_config core.compression 0 && + test_when_finished rm -rf expensive-repo && + git init expensive-repo && + ( + cd expensive-repo && + git config set core.compression 0 && + git config set maintenance.auto false && - for i in $(test_seq 1 5) - do - test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big || - return 1 - done && - git add big && - git commit -qm "Add big file (1)" && + for i in $(test_seq 1 5) + do + test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big || + return 1 + done && + git add big && + git commit -qm "Add big file (1)" && - # ensure any possible loose objects are in a pack-file - git maintenance run --task=loose-objects && + # ensure any possible loose objects are in a pack-file + git maintenance run --task=loose-objects && - rm big && - for i in $(test_seq 6 10) - do - test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big || - return 1 - done && - git add big && - git commit -qm "Add big file (2)" && + rm big && + for i in $(test_seq 6 10) + do + test-tool genrandom foo$i $((512 * 1024 * 1024 + 1)) >>big || + return 1 + done && + git add big && + git commit -qm "Add big file (2)" && - # ensure any possible loose objects are in a pack-file - git maintenance run --task=loose-objects && + # ensure any possible loose objects are in a pack-file + git maintenance run --task=loose-objects && - # Now run the incremental-repack task and check the batch-size - GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \ - --task=incremental-repack 2>/dev/null && - test_subcommand git multi-pack-index repack \ - --no-progress --batch-size=2147483647 <run-2g.txt + # Now run the incremental-repack task and check the batch-size + GIT_TRACE2_EVENT="$(pwd)/run-2g.txt" git maintenance run \ + --task=incremental-repack 2>/dev/null && + test_subcommand git multi-pack-index repack \ + --no-progress --batch-size=2147483647 <run-2g.txt + ) ' run_incremental_repack_and_verify () {
--
2.55.0.795.g602f6c329a.dirty