All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Lars Schneider <larsxschneider@gmail.com>
Cc: Fredrik Medley <fredrik.medley@gmail.com>,
	peff@peff.net, patrick.reynolds@github.com,
	Git Users <git@vger.kernel.org>
Subject: Re: [RFC] t5516 "75 - deny fetch unreachable SHA1, allowtipsha1inwant=true" flaky?
Date: Fri, 30 Oct 2015 14:00:08 -0700	[thread overview]
Message-ID: <xmqqvb9ojcmf.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqq8u6qluh2.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Sun, 25 Oct 2015 10:38:01 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> 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

  reply	other threads:[~2015-10-30 21:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-24 13:08 [RFC] t5516 "75 - deny fetch unreachable SHA1, allowtipsha1inwant=true" flaky? Lars Schneider
2015-10-25  7:18 ` Fredrik Medley
2015-10-25 13:47   ` Lars Schneider
2015-10-25 17:38     ` Junio C Hamano
2015-10-30 21:00       ` Junio C Hamano [this message]
2015-10-30 21:22         ` [PATCH] test: accept death by SIGPIPE as a valid failure mode Junio C Hamano
2015-11-05  7:47           ` Jeff King
2015-11-05  9:34             ` Lars Schneider
2015-11-05 16:21               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqvb9ojcmf.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=fredrik.medley@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    --cc=patrick.reynolds@github.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.