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

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" &&
Previous: Johannes SixtNext: Johannes Sixt
Message 2 of 11 in “t6026-merge-attr: wait for process to release trash directory”
  1. t6026-merge-attr: wait for process to release trash directoryJohannes Sixt, Sep 5, 2016
  2. Johannes SchindelinSep 6, 2016
  3. t6026-merge-attr: clean up background process at end of test caseJohannes Sixt, Sep 7, 2016
  4. Johannes SchindelinSep 7, 2016
  5. Jeff KingSep 6, 2016
  6. Junio C HamanoSep 7, 2016
  7. Jeff KingSep 7, 2016
  8. Junio C HamanoSep 7, 2016
  9. Johannes SchindelinSep 8, 2016
  10. Jeff KingSep 8, 2016
  11. Johannes SchindelinSep 9, 2016

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.