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

[PATCH] t6026-merge-attr: wait for process to release trash directory

From
Johannes Sixt <j6t@kdbg.org>
Date
Sep 5, 2016, 19:03 UTC
Message-ID
<3fd38b71-26bd-bdb3-fe5c-e7038abf51e0@kdbg.org>

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.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t6026-merge-attr.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh
index dd8f88d..2c5b138 100755
--- a/t/t6026-merge-attr.sh
+++ b/t/t6026-merge-attr.sh
@@ -191,7 +191,10 @@ test_expect_success 'custom merge does not lock index' '
 		"* merge=ours" "text merge=sleep-one-second" &&
 	test_config merge.ours.driver true &&
 	test_config merge.sleep-one-second.driver ./sleep-one-second.sh &&
-	git merge master
+	git merge master &&
+	# the trash directory cannot be removed on Windows until the hook
+	# does not occupy it for its CWD anymore; wait for it to quit:
+	sleep 1
 '
 
 test_done
-- 
2.10.0.85.gea34e30
Next: Johannes Schindelin
Message 1 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.