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

Re: [PATCH/RFC] test-lib: clean up trash* directories on SIGINT

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 12, 2010, 08:16 UTC
Message-ID
<AANLkTinGsIqy-rG8um1E7_zfla1KwsO2Z26JnchXaRLd@mail.gmail.com>
In-Reply-To
<20100712061608.GA6140@burratino>
On Mon, Jul 12, 2010 at 06:16, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 8 quoted lines
> Hi Ævar,
>
> Ævar Arnfjörð Bjarmason wrote:
>
>> Unless that's due to some unreproducable heisenbug you could get the
>> trash directory by running the test with --debug.
>
> So what should I do after noticing a heisenbug?

Run the test again with --debug. The test library and the commands it's calling don't live in the same address space. A "heisenbug" will probably be just as reproducable with --debug and without --debug.

Show 9 quoted lines
>> These trash directories are explicitly temporary, and
>> should be cleaned up as the shell exists.
>
> When tests learned to remove the trash directory in test_done in
> v1.6.1-rc1~336^2~1 (Enable parallel tests, 2008-08-08), that was not
> the rationale; it was rather to avoid too many trash directories
> piling up.  If a test exits by mistake with ‘exit’ or fails with ‘-i’,
> the one or two scratch directories involved are still kept for
> debugging.

That's the original rationale, which is fair enough. I think the behavior should be to clean up temporary files when the test exits, not just when it's done executing.

> So you can see why a person would be reluctant to change this for
> aesthetic reasons only.

The reason I want to change it is that as I'm hacking Git I often run the tests but kill them before they've completed, because if I'm e.g. testing the test library itself I'm content with having only 10 tests pass before I continue improving it.

If I keep doing that (along with --jobs 20 and --shuffle) I'll eventually pile up ~200 MB of trash. That'll exceed the limits of my ramdisk and I'll have to grudgingly do rm -rf trash* again.

But maybe people such as yourself depend on the current behavior with regards to SIGINT. I don't feel strongly about it, and having to remove trash is a minor annoyance.

If it's being used it should be kept. I just assumed that it was an omission in the cleanup routines.

Previous: Jonathan NiederNext: Jonathan Nieder
Message 6 of 7 in “test-lib: clean up trash* directories on SIGINT”
  1. test-lib: clean up trash* directories on SIGINTÆvar Arnfjörð Bjarmason, Jul 11, 2010
  2. Andreas SchwabJul 11, 2010
  3. Nicolas PitreJul 12, 2010
  4. Ævar Arnfjörð BjarmasonJul 12, 2010
  5. Jonathan NiederJul 12, 2010
  6. Ævar Arnfjörð BjarmasonJul 12, 2010
  7. Jonathan NiederJul 12, 2010

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.