Re: [PATCH] t6026-merge-attr: wait for process to release trash directory
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 6, 2016, 07:25 UTC
- Message-ID
- <alpine.DEB.2.20.1609060909420.129229@virtualbox>
- In-Reply-To
- <3fd38b71-26bd-bdb3-fe5c-e7038abf51e0@kdbg.org>
Hi Hannes,
On Mon, 5 Sep 2016, Johannes Sixt wrote:
Show 5 quoted lines
> 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.
Maybe we should write a pid file in the sleep command instead, and kill it in the end? Something like this, maybe?
-- snipsnap --
diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh index dd8f88d..2e2beb5 100755 --- a/t/t6026-merge-attr.sh +++ b/t/t6026-merge-attr.sh @@ -184,8 +184,10 @@ test_expect_success 'up-to-date merge without common ancestor' ' test_expect_success 'custom merge does not lock index' ' git reset --hard anchor && write_script sleep-one-second.sh <<-\EOF && - sleep 1 & + sleep 10 & + echo $! >sleep.pid EOF + test_when_finished "kill -9 \$(cat sleep.pid)" && test_write_lines >.gitattributes \ "* merge=ours" "text merge=sleep-one-second" &&