Hi Hannes,

On Mon, 5 Sep 2016, 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.

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" &&

Reply via email to