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

Re: [PATCH 1/2] t7900: adapt some tests to use a throwaway repository

From
Karthik Nayak <karthik.188@gmail.com>
Date
Aug 13, 2026, 12:07 UTC
Message-ID
<CAOLa=ZRXoqtYfDYhTatXZt9ojP2_5WrtJY7exR_TEPHZVqEE2A@mail.gmail.com>
In-Reply-To
<anxF0P0KVizediDg@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 33 quoted lines
> On Wed, Aug 12, 2026 at 01:19:13AM -0700, Karthik Nayak wrote:
>> Patrick Steinhardt <ps@pks.im> writes:
>> > 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' '
> [snip]
>> >  test_expect_success 'maintenance.auto overrides gc.auto' '
>> > -	test_when_finished "rm -f trace" &&
>> > +	test_when_finished "rm -rf repo" &&
>> > +	git init repo &&
>> > +	(
>> > +		cd repo &&
>> >
>> > -	test_config maintenance.auto false &&
>> > -	test_config gc.auto 1 &&
>> > -	GIT_TRACE2_EVENT="$(pwd)/trace" git commit --quiet --allow-empty -m 1 &&
>> > -	test_subcommand ! git maintenance run --auto --quiet --detach <trace &&
>> > +		git config set maintenance.auto false &&
>> > +		git config set gc.auto 1 &&
>>
>> So we change from using `test_config` to `git config`, I assume this is
>> because earlier since we used a shared folder, we had to undo any config
>> changes made. Now that's no longer needed. Nit: This is okay, but
>> would've been nicer to call out.
>
> The issue with `test_config` is that it executes `test_when_finished`,
> and that function cannot run in subshells. So we have to use `git config
> set` instead, but because it's a throw-away repository it doesn't
> matter.
>
> Patrick
Right, that slipped my mind entirely.
Previous: Patrick SteinhardtNext: Karthik Nayak
Message 5 of 13 in “t7900: fix flaky "maintenance.strategy" test”
  1. 0/2 t7900: fix flaky "maintenance.strategy" testPatrick Steinhardt, Aug 7, 2026
  2. 1/2 t7900: adapt some tests to use a throwaway repositoryPatrick Steinhardt, Aug 7, 2026
  3. Karthik NayakAug 12, 2026
  4. Patrick SteinhardtAug 12, 2026
  5. Karthik NayakAug 13, 2026
  6. Karthik NayakAug 12, 2026
  7. 2/2 t7900: fix flaky "maintenance.strategy" testPatrick Steinhardt, Aug 7, 2026
  8. Karthik NayakAug 12, 2026
  9. Patrick SteinhardtAug 12, 2026
  10. 0/2 t7900: fix flaky "maintenance.strategy" testPatrick Steinhardt, Aug 12, 2026
  11. 1/2 t7900: adapt some tests to use a throwaway repositoryPatrick Steinhardt, Aug 12, 2026
  12. 2/2 t7900: fix flaky "maintenance.strategy" testPatrick Steinhardt, Aug 12, 2026
  13. Karthik NayakAug 13, 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.