From: Patrick Steinhardt Date: Fri, 07 Aug 2026 10:59:01 GMT Subject: [PATCH 1/2] t7900: adapt some tests to use a throwaway repository Message-ID: <20260807-pks-t7900-fix-flaky-test-v1-1-08d0ea0fbbc5@pks.im> In-Reply-To: <20260807-pks-t7900-fix-flaky-test-v1-0-08d0ea0fbbc5@pks.im> Many of the tests in t7900 operate inside the main trash repository that's set up by default by our test suite. This is overall quite fragile as we're exercising repository maintenance in those tests, and maintenance is of course intricately tied towards the on-disk state of a repository. Consequently, the tests can easily impact one another. Furthermore, in the next commit we'll have to modify the environment in a handful of those tests. As tests don't run in a subshell, doing so would impact all subsequent tests by default, as well. Adapt exactly those tests to use a throwaway repository. This makes the tests more neatly self-contained and allows us to trivially modify the environment in the next commit. Signed-off-by: Patrick Steinhardt --- t/t7900-maintenance.sh | 70 +++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index 4238569b68..6735a9e082 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -67,41 +67,57 @@ test_expect_success 'run [--auto|--quiet] with gc strategy' ' ' test_expect_success 'maintenance.auto config option' ' - GIT_TRACE2_EVENT="$(pwd)/default" git commit --quiet --allow-empty -m 1 && - test_subcommand git maintenance run --auto --quiet --detach