[PATCH] Broken pipe in smokecurrent.log

[email protected] (Bram) Fri, 08 Aug 2008 19:43:49 +0200
Newsgroups perl.daily-build
Message-ID <[email protected]>
--=_4p4o3jvy4fms
Content-Type: text/plain;
	charset=ISO-8859-1;
	DelSp="Yes";
	format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Minor fix in the collection of the harness output.

Without this patch smokecurrent.log contains:

pod/twice..........................................................ok
x2p/s2p............................................................ok
All tests successful.
make[2]: *** [_test_tty] Error 141
make[1]: *** [_test] Error 141
make: *** [test_harness] Broken pipe

error while running harness target 'test_harness': 2 at =20
/opt/perl/libs/local/share/perl/5.6.1/Test/Smoke.pm line 188

All tests successful.

Archived results...


With the patch:

pod/twice..........................................................ok
x2p/s2p............................................................ok
All tests successful.
Files=3D1530, Tests=3D200239, 513 wallclock secs (25.97 usr  3.67 sys + =20
269.20 cusr 18.60 csys =3D 317.44 CPU)
Result: PASS
make[2]: Leaving directory `/opt/perl/perl-5.10.x'
make[1]: Leaving directory `/opt/perl/perl-5.10.x'

All tests successful.

Archived results...


I believe this is related to:

#!/usr/bin/perl -wl
open FH, qq(echo "foo" ; echo "bar" |);
while (<FH>) {
   last if m/foo/;
}
close FH or do { die "Error closing: $! & $?\n"; }'
__END__

Output: Error closing:  & 13

(This was with perl-5.6.1, but note that this isn't reproduceable everywhere=
.)


--=_4p4o3jvy4fms
Content-Type: text/x-patch;
	charset=ISO-8859-1;
	name="patch_broken_pipe"
Content-Disposition: attachment;
	filename="patch_broken_pipe"
Content-Transfer-Encoding: quoted-printable

diff -Naur old/lib/Test/Smoke/Smoker.pm new/lib/Test/Smoke/Smoker.pm
--- old/lib/Test/Smoke/Smoker.pm=092008-04-18 19:04:32.000000000 +0200
+++ new/lib/Test/Smoke/Smoker.pm=092008-08-08 17:51:18.000000000 +0200
@@ -634,6 +634,7 @@
     my( $self, $target, $extra ) =3D @_;
=20
     my $seenheader =3D 0;
+    my $done =3D 0;
     my @failed =3D ( );
=20
     my $harness_re1 =3D HARNESS_RE1();
@@ -644,8 +645,9 @@
     my $line;
     while ( $line =3D <$tst> ) {
         $self->{v} > 1 and $self->tty( $line );
+        $done and next;
=20
-        $line =3D~ /All tests successful/ and push( @failed, $line ), last;
+        $line =3D~ /All tests successful/ and push( @failed, $line ) and $d=
one =3D 1, next;
=20
         $line =3D~ /Failed Test\s+Stat/ and $seenheader =3D 1, next;
         $seenheader or next;
@@ -684,6 +686,7 @@
=20
     my $harness3_re =3D HARNESS3_RE();
     my $seenheader =3D 0;
+    my $done =3D 0;
     my @failed =3D ( );
=20
     my $tst =3D $self->_make_fork( $target, $extra );
@@ -691,8 +694,9 @@
     my $line;
     while ( $line =3D <$tst> ) {
         $self->{v} > 1 and $self->tty( $line );
+        $done and next;
=20
-        $line =3D~ /All tests successful/ and push( @failed, $line ), last;
+        $line =3D~ /All tests successful/ and push( @failed, $line ) and $d=
one =3D 1, next;
=20
         $line =3D~ /Test Summary Report/ and $seenheader =3D 1, next;
         $seenheader or next;

--=_4p4o3jvy4fms--