Re: [PATCH] t6026-merge-attr: wait for process to release trash directory
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 7, 2016, 18:39 UTC
- Message-ID
- <xmqq4m5rmu4i.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160906072707.goysliw32xgwmlol@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 16 quoted lines
> On Mon, Sep 05, 2016 at 09:03:48PM +0200, Johannes Sixt wrote: > >> The process spawned in the hook uses the test's trash directory as CWD. >> As long as it is alive, the directory cannot be removed on Windows. >> Although the test succeeds, the 'test_done' that follows produces an >> error message and leaves the trash directory around. Insert a delay to >> give the hook time to go away. > > Ugh. I'd love it if we could avoid inserting a sleep, which wastes time > in the optimistic case and is insufficient in the pessimistic one. > > The fact that the hook is already using sleep is even nastier, as it > that's a potential race on a loaded system. > > Can we do some signaling with fifos to tell the hook when it is safe to > exit? Then we would just need to `wait` for its parent process.
Is fifo safe on Windows, though?
With v2 that explicitly kills, I guess we can make the sleep longer without slowing down in the optimistic case?