git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: "Thomas Rast" <trast@student.ethz.ch>,
	"Junio C Hamano" <gitster@pobox.com>,
	git@vger.kernel.org, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Michael Haggerty" <mhagger@alum.mit.edu>
Subject: Re: tr/pty-all (Re: What's cooking in git.git (Dec 2011, #04; Tue, 13))
Date: Wed, 14 Dec 2011 17:31:19 -0600	[thread overview]
Message-ID: <20111214233119.GA2354@elie> (raw)
In-Reply-To: <20111214232151.GB13128@sigill.intra.peff.net>

Jeff King wrote:

[...]
> A test which accidentally reads stdin would soak up all of
> the rest of the input intended for the outer shell loop.
> 
> Let's redirect stdin from a known source to eliminate
> variation. We could just connect it to /dev/null. However,
> tests which accidentally read stdin would then see immediate
> EOF, which may or may not cause them to notice the errror.
[...]
> +++ b/t/test-lib.sh
[...]
> @@ -469,7 +471,7 @@ test_debug () {
>  test_eval_ () {
>  	# This is a separate function because some tests use
>  	# "return" to end a test_expect_success block early.
> -	eval >&3 2>&4 "$*"
> +	eval <"$TEST_DIRECTORY/stdin-garbage" >&3 2>&4 "$*"

How about /dev/urandom on platforms that support it?  It wouldn't be
as pleasant to debug as "This is a magic stdin garbage stream", but it
would be more likely to (despite the name :)) predictably trip errors,
or at least hangs, in problematic tests.

With or without something along those lines on top, your patch looks
like a good change.

Thanks for a thoughtful analysis.
Jonathan

  reply	other threads:[~2011-12-14 23:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14  1:19 What's cooking in git.git (Dec 2011, #04; Tue, 13) Junio C Hamano
2011-12-14  7:09 ` tr/pty-all (Re: What's cooking in git.git (Dec 2011, #04; Tue, 13)) Jonathan Nieder
2011-12-14 16:17   ` Thomas Rast
2011-12-14 17:42     ` Junio C Hamano
2011-12-14 23:07     ` Jeff King
2011-12-14 23:21       ` Jeff King
2011-12-14 23:31         ` Jonathan Nieder [this message]
2011-12-15  0:25           ` Jeff King
2011-12-15  0:50             ` Jeff King
2011-12-15  3:23               ` Junio C Hamano
2011-12-15  6:55                 ` Jeff King
2011-12-15 18:19                   ` 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=20111214233119.GA2354@elie \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alum.mit.edu \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=trast@student.ethz.ch \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).