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

[PATCH v2] t6026-merge-attr: don't fail if sleep exits early

From
Andreas Schwab <schwab@suse.de>
Date
Nov 10, 2016, 08:31 UTC
Message-ID
<mvm8tsrbusp.fsf_-_@hawking.suse.de>
In-Reply-To
<20161109153128.aqm2lgdntdlycnaq@sigill.intra.peff.net>

Commit 5babb5bdb3 ("t6026-merge-attr: clean up background process at end of test case") added a kill command to clean up after the test, but this can fail if the sleep command exits before the cleanup is executed. Ignore the error from the kill command.

Explicitly check for the existence of the pid file to test that the merge driver was actually called.

Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 t/t6026-merge-attr.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh
index 7a6e33e673..03d13d00b5 100755
--- a/t/t6026-merge-attr.sh
+++ b/t/t6026-merge-attr.sh
@@ -187,13 +187,14 @@ test_expect_success 'custom merge does not lock index' '
 		sleep 1 &
 		echo $! >sleep.pid
 	EOF
-	test_when_finished "kill \$(cat sleep.pid)" &&
+	test_when_finished "kill \$(cat sleep.pid) || :" &&
 
 	test_write_lines >.gitattributes \
 		"* 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 &&
+	test -f sleep.pid
 '
 
 test_done
-- 
2.10.2


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Previous: Jeff KingNext: Junio C Hamano
Message 6 of 12 in “t6026-merge-attr: don't fail if sleep exits early”
  1. t6026-merge-attr: don't fail if sleep exits earlyAndreas Schwab, Nov 8, 2016
  2. Jeff KingNov 8, 2016
  3. Johannes SchindelinNov 9, 2016
  4. Andreas SchwabNov 9, 2016
  5. Jeff KingNov 9, 2016
  6. t6026-merge-attr: don't fail if sleep exits earlyAndreas Schwab, Nov 10, 2016
  7. Junio C HamanoNov 10, 2016
  8. Johannes SchindelinNov 10, 2016
  9. Junio C HamanoNov 10, 2016
  10. Jeff KingNov 10, 2016
  11. Junio C HamanoNov 10, 2016
  12. Jeff KingNov 10, 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.