git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, David Barr <david.barr@cordelta.com>
Subject: Re: [PATCH] Portability: returning void
Date: Tue, 29 Mar 2011 19:29:21 -0500	[thread overview]
Message-ID: <20110330002921.GC14578@elie> (raw)
In-Reply-To: <20110330001653.GA1161@sigill.intra.peff.net>

(-cc: Michael, to stop spamming a kind bug reporter :))
Jeff King wrote:
> On Tue, Mar 29, 2011 at 06:49:55PM -0500, Jonathan Nieder wrote:

>> | 19424 18:31:25 <... nanosleep resumed> NULL) = 0
>> | 19424 18:31:25 close(1)                 = 0
>> | 19424 18:31:25 close(2)                 = 0
>> | 19424 18:31:25 exit_group(0)            = ?
>> | 19422 18:31:25 <... wait4 resumed> 0x7fff65d1ee6c, 0, NULL) = ? ERESTARTSYS (To be restarted)
>> | 19422 18:31:25 --- SIGTERM (Terminated) @ 0 (0) ---
>> 
>> The first sleep wakes up and dies.  The corresponding subshell
>> wakes up, reaps the child, and finally accepts SIGTERM.
>
> Hrm. That's different than what happens on my system. On my system, the
> bash process is _already_ dead during the whole procedure, and it is
> just the stray sleeps that keep prove waiting.
>
> Maybe different bash versions? Mine is 4.1.5(1) (from debian unstable,
> bash_4.1-3).

$ dpkg-query -W perl bash
bash	4.1-3
perl	5.10.1-18

Same version here, but I had modified the test a little.  *tries the
stock version again*  Same behavior still.  FWIW I am using the patch
below[1] and invoking the tests as

	strace -f -o trace.out prove --exec=bash -v t0081-line-buffer.sh :: -v -i

> Did you try my 5>/dev/null patch? With it, I get no hang at all.

Haven't tried it yet but will try.

I really don't like that as a long-term solution.  Yes, it gets prove
to stop hanging, but meanwhile we have no control over the child
processes we have spawned.  I'd rather just drop the tests.
---
diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
index 1dbe1c9..054bffa 100755
--- a/t/t0081-line-buffer.sh
+++ b/t/t0081-line-buffer.sh
@@ -49,13 +49,14 @@ long_read_test () {
 	{
 		{
 			generate_tens_of_lines $tens_of_lines "$line" &&
-			sleep 100
+			sleep 15
 		} >input &
 	} &&
 	test-line-buffer input <<-EOF >output &&
 	binary $readsize
 	copy $copysize
 	EOF
+	pstree -p $! &&
 	kill $! &&
 	test_line_count = $lines output &&
 	tail -n 1 <output >actual &&
@@ -84,12 +85,13 @@ test_expect_success PIPE '0-length read, no input available' '
 	rm -f input &&
 	mkfifo input &&
 	{
-		sleep 100 >input &
+		sleep 15 >input &
 	} &&
 	test-line-buffer input <<-\EOF >actual &&
 	binary 0
 	copy 0
 	EOF
+	pstree -p $! &&
 	kill $! &&
 	test_cmp expect actual
 '
@@ -112,13 +114,14 @@ test_expect_success PIPE '1-byte read, no input available' '
 		{
 			printf "%s" a &&
 			printf "%s" b &&
-			sleep 100
+			sleep 15
 		} >input &
 	} &&
 	test-line-buffer input <<-\EOF >actual &&
 	binary 1
 	copy 1
 	EOF
+	pstree -p $! &&
 	kill $! &&
 	test_cmp expect actual
 '
-- 

  reply	other threads:[~2011-03-30  0:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 17:31 [PATCH] Portability: returning void Michael Witten
2011-03-29 20:02 ` Jonathan Nieder
2011-03-29 22:16   ` Jeff King
2011-03-29 22:36     ` Jeff King
2011-03-29 23:49     ` Jonathan Nieder
2011-03-30  0:16       ` Jeff King
2011-03-30  0:29         ` Jonathan Nieder [this message]
2011-03-30  3:30           ` Jeff King
2011-03-30  3:57             ` Jonathan Nieder
2011-03-30  4:13               ` Jeff King
2011-03-30  6:54                 ` Johannes Sixt
2011-03-30  8:16                   ` [PATCH/RFC svn-fe] tests: introduce helper to fill a pipe in the background Jonathan Nieder
2011-03-30  8:41                 ` [PATCH] Portability: returning void Jonathan Nieder
2011-03-30 12:40                   ` Jeff King
2011-03-30 18:54                     ` Jonathan Nieder
2011-03-30  4:41             ` [PULL svn-fe] " Jonathan Nieder
2011-03-30 19:31               ` Junio C Hamano
2011-03-30  0:42         ` [PATCH] " Jonathan Nieder

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=20110330002921.GC14578@elie \
    --to=jrnieder@gmail.com \
    --cc=david.barr@cordelta.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 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).