git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 6/9] t7900: clean up large EXPENSIVE repository

From
Patrick Steinhardt <ps@pks.im>
Date
Jul 6, 2026, 06:24 UTC
Message-ID
<20260706-b4-pks-t-fixes-for-GIT-TEST-LONG-v3-6-4f6c5a37fd1f@pks.im>
In-Reply-To
<20260706-b4-pks-t-fixes-for-GIT-TEST-LONG-v3-0-4f6c5a37fd1f@pks.im>

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 <ps@pks.im>
---
 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
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 7 of 12 in “t: fixes and improvements for GIT_TEST_LONG”
  1. 0/9 t: fixes and improvements for GIT_TEST_LONGPatrick Steinhardt, Jul 6, 2026
  2. 1/9 README: add GitLab CI badge to make it more discoverablePatrick Steinhardt, Jul 6, 2026
  3. 2/9 t0021: skip EXPENSIVE test that is broken without SIZE_T_IS_64BITPatrick Steinhardt, Jul 6, 2026
  4. 3/9 t4141: fix inefficient use of dd(1)Patrick Steinhardt, Jul 6, 2026
  5. 4/9 t5608: reduce maximum disk usagePatrick Steinhardt, Jul 6, 2026
  6. 5/9 t7508: skip EXPENSIVE test that is broken without SIZE_T_IS_64BITPatrick Steinhardt, Jul 6, 2026
  7. 6/9 t7900: clean up large EXPENSIVE repositoryPatrick Steinhardt, Jul 6, 2026
  8. 7/9 t: use `test_bool_env` to parse GIT_TEST_LONGPatrick Steinhardt, Jul 6, 2026
  9. 8/9 gitlab-ci: disable RAM disk on macOS jobsPatrick Steinhardt, Jul 6, 2026
  10. 9/9 gitlab-ci: enable "GIT_TEST_LONG"Patrick Steinhardt, Jul 6, 2026
  11. Junio C HamanoJul 6, 2026
  12. Jeff KingJul 7, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.