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

Re: [RFC] t5516 "75 - deny fetch unreachable SHA1, allowtipsha1inwant=true" flaky?

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 30, 2015, 21:00 UTC
Message-ID
<xmqqvb9ojcmf.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqq8u6qluh2.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
> That leaves us to something along this line...
>
>> (3) Add a method "test_must_fail_or_die" to
>> "test-lib-functions.sh". This method accepts exit codes 129<x<192,
>> too. Use the new method in t5516.
>
> ... but I have to wonder if 129<x<192 is loosening too much, given
> that the only error we expect, other than the orderly shutdown, is
> reception of sigpipe.

So, how about doing something like this as a starter. All of the object transport codepath share "we may notice that the other end disconnected, or that the other end explicitly told us it found an error, and die, or the other end may have died, perhaps after giving a human-readable error message, and we end up dying when we try to tell them more with SIGPIPE", and that by itself is not a bug in the real life---we will exit with non-zero status and that is a sign enough for the user to know that the command has failed.

 t/test-lib-functions.sh | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 6dffb8b..b1f950d 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -579,6 +579,9 @@ test_must_fail () {
 	if test $exit_code = 0; then
 		echo >&2 "test_must_fail: command succeeded: $*"
 		return 1
+	elif test $exit_code -eq 141; then
+		echo >&2 "test_must_fail: died with sigpipe: $*"
+		return 0
 	elif test $exit_code -gt 129 && test $exit_code -le 192; then
 		echo >&2 "test_must_fail: died by signal: $*"
 		return 1
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 9 in “[RFC] t5516 "75 - deny fetch unreachable SHA1, allowtipsha1inwant=true" flaky?”
  1. Lars SchneiderOct 24, 2015
  2. Fredrik MedleyOct 25, 2015
  3. Lars SchneiderOct 25, 2015
  4. Junio C HamanoOct 25, 2015
  5. Junio C HamanoOct 30, 2015
  6. test: accept death by SIGPIPE as a valid failure modeJunio C Hamano, Oct 30, 2015
  7. Jeff KingNov 5, 2015
  8. Lars SchneiderNov 5, 2015
  9. Junio C HamanoNov 5, 2015

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.