Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip count is wrong for timeout in dist/Tie-File/t/29_downcopy.t #12677

Closed
p5pRT opened this issue Dec 30, 2012 · 9 comments
Closed

skip count is wrong for timeout in dist/Tie-File/t/29_downcopy.t #12677

p5pRT opened this issue Dec 30, 2012 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 30, 2012

Migrated from rt.perl.org#116250 (status was 'resolved')

Searchable as RT116250$

@p5pRT
Copy link
Author

p5pRT commented Dec 30, 2012

From @nwc10

On Tue, Dec 25, 2012 at 06​:22​:00PM -0500, George Greer wrote​:

Smoke logs available at http​://m-l.org/~perl/smoke/perl/linux/blead_clang_quick/log8d40577bdbdfa85ed3293f84bf26a313b1b92f55.log.gz

Automated smoke report for 5.17.8 patch 8d40577 v5.17.7.0-107-g8d40577
zwei​: Intel(R) Core(TM) i7 CPU 920 @​ 2.67GHz (GenuineIntel 2668MHz) (x86_64/8 cpu)

Testsuite was run only with 'harness'

Failures​: (common-args) -Accflags=-DPERL_POISON -Dcc=clang
[default]
../dist/Tie-File/t/29_downcopy.t............................FAILED
443-444
Bad plan. You planned 718 tests but ran 716.

I infer that the "bad plan" is because the skip count is wrong if the
timeout hits. The main test code looks like this​:

sub try {
  my ($pos, $len, $newlen) = @​_;

...

  if ($err) {
  if ($err =~ /^Alarm clock/) {
  print "# Timeout\n";
  print "not ok $N\n"; $N++;
  print "not ok $N\n"; $N++;
  return;
  } else {
  $@​ = $err;
  die;
  }
  }

...

  if (defined $len) {
  try($pos, undef, $newlen);
  }
}

Hence if try() is called with a $len defined and timeout hits, it prints out
two "not ok"s, then returns immediately. Whereas in the normal case (no
timeout) it runs 4 tests - the 2 at this level, and 2 more when it recurses.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Dec 15, 2013

From @jkeenan

On Sun Dec 30 03​:04​:36 2012, nicholas wrote​:

On Tue, Dec 25, 2012 at 06​:22​:00PM -0500, George Greer wrote​:

Smoke logs available at http​://m-
l.org/~perl/smoke/perl/linux/blead_clang_quick/log8d40577bdbdfa85ed3293f84bf26a313b1b92f55.log.gz

Automated smoke report for 5.17.8 patch
8d40577 v5.17.7.0-107-g8d40577
zwei​: Intel(R) Core(TM) i7 CPU 920 @​ 2.67GHz (GenuineIntel 2668MHz)
(x86_64/8 cpu)

Testsuite was run only with 'harness'

Failures​: (common-args) -Accflags=-DPERL_POISON -Dcc=clang
[default]
../dist/Tie-File/t/29_downcopy.t............................FAILED
443-444
Bad plan. You planned 718 tests but ran 716.

I infer that the "bad plan" is because the skip count is wrong if the
timeout hits. The main test code looks like this​:

sub try {
my ($pos, $len, $newlen) = @​_;

...

if ($err) {
if ($err =~ /^Alarm clock/) {
print "# Timeout\n";
print "not ok $N\n"; $N++;
print "not ok $N\n"; $N++;
return;
} else {
$@​ = $err;
die;
}
}

...

if (defined $len) {
try($pos, undef, $newlen);
}
}

Hence if try() is called with a $len defined and timeout hits, it
prints out
two "not ok"s, then returns immediately. Whereas in the normal case
(no
timeout) it runs 4 tests - the 2 at this level, and 2 more when it
recurses.

Nicholas Clark

Would this be fixed simply by printing 'not ok' two more times?

@p5pRT
Copy link
Author

p5pRT commented Dec 15, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 29, 2016

From @dcollinsn

On Sun Dec 15 13​:56​:26 2013, jkeenan wrote​:

Would this be fixed simply by printing 'not ok' two more times?

I think this is the necessary patch, to print 2 fails if the timeout happens in the recursive call, or 4 fails if it happens in the parent.

--
Respectfully,
Dan Collins

@p5pRT
Copy link
Author

p5pRT commented Sep 29, 2016

From @dcollinsn

0001-RT-115980-Fail-the-right-number-of-tests-on-timeout.patch
From 7b2ef8c50216b493a4de1405e6a90a516a0f333e Mon Sep 17 00:00:00 2001
From: Dan Collins <dcollinsn@gmail.com>
Date: Thu, 29 Sep 2016 11:23:00 -0400
Subject: [PATCH] RT #115980: Fail the right number of tests on timeout

---
 dist/Tie-File/t/29_downcopy.t | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dist/Tie-File/t/29_downcopy.t b/dist/Tie-File/t/29_downcopy.t
index d75806d..72943ad 100644
--- a/dist/Tie-File/t/29_downcopy.t
+++ b/dist/Tie-File/t/29_downcopy.t
@@ -279,6 +279,11 @@ sub try {
       print "# Timeout\n";
       print "not ok $N\n"; $N++;
       print "not ok $N\n"; $N++;
+      if ($defined $len) {
+        # Fail the tests in the recursive call as well
+        print "not ok $N\n"; $N++;
+        print "not ok $N\n"; $N++;
+      }
       return;
     } else {
       $@ = $err;
-- 
2.9.3

@p5pRT
Copy link
Author

p5pRT commented Sep 29, 2016

From [Unknown Contact. See original ticket]

On Sun Dec 15 13​:56​:26 2013, jkeenan wrote​:

Would this be fixed simply by printing 'not ok' two more times?

I think this is the necessary patch, to print 2 fails if the timeout happens in the recursive call, or 4 fails if it happens in the parent.

--
Respectfully,
Dan Collins

@p5pRT
Copy link
Author

p5pRT commented Sep 29, 2016

From @jkeenan

On Thu Sep 29 08​:27​:52 2016, dcollinsn@​gmail.com wrote​:

On Sun Dec 15 13​:56​:26 2013, jkeenan wrote​:

Would this be fixed simply by printing 'not ok' two more times?

I think this is the necessary patch, to print 2 fails if the timeout
happens in the recursive call, or 4 fails if it happens in the parent.

Had to correct one syntax error in patch ($defined) and reference to incorrect RT number in commit message.

Pushed to blead in commit 5654fe3. Will monitor for no more than 7 days, then close ticket.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2016

From @jkeenan

On Thu Sep 29 11​:31​:54 2016, jkeenan wrote​:

On Thu Sep 29 08​:27​:52 2016, dcollinsn@​gmail.com wrote​:

On Sun Dec 15 13​:56​:26 2013, jkeenan wrote​:

Would this be fixed simply by printing 'not ok' two more times?

I think this is the necessary patch, to print 2 fails if the timeout
happens in the recursive call, or 4 fails if it happens in the
parent.

Had to correct one syntax error in patch ($defined) and reference to
incorrect RT number in commit message.

Pushed to blead in commit 5654fe3.
Will monitor for no more than 7 days, then close ticket.

Thank you very much.

No complaints registered; marking ticket Resolved.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2016

@jkeenan - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant