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

ext/File-Find/t/*.t: Continued intermittent failures during parallel testing #16814

Closed
p5pRT opened this issue Jan 15, 2019 · 21 comments
Closed

Comments

@p5pRT
Copy link

p5pRT commented Jan 15, 2019

Migrated from rt.perl.org#133771 (status was 'pending release')

Searchable as RT133771$

@p5pRT
Copy link
Author

p5pRT commented Jan 15, 2019

From @jkeenan

We are still having intermittent problems with parallel testing in
ext/Find-Find/t/*.t. Consider this smoke test report​:

http​://perl5.test-smoke.org/report/77754

In this smoke-test configuration 'make test_harness' runs 36 times. In
1 of those instances I get this failure in ext/File-Find/t/find.t
(hereinafter, "find.t" for short).

#####
Test failures​:
~~ ../ext/File-Find/t/find.t ................................... FAILED
Non-zero exit status​: 2 Bad plan. You planned 238 tests but ran 7.
  [stdio] -Duseithreads -Doptimize="-O2 -pipe -fstack-protector
-fno-strict-aliasing" -Dcc="gcc" -Dusemorebits DEBUGGING
#####

(See also this (out-of-date) matrix report​:
http​://perl5.test-smoke.org/submatrix?test=../ext/File-Find/t/find.t.)

When I examine the log for this instance, I see​:

#####
Configuration​: -Dusedevel -Duseithreads -Doptimize="-O2 -pipe
-fstack-protector -fno-strict-aliasing" -Dcc="gcc" -Dusemorebits -DDEBUGGING

[2019-01-07 07​:15​:35+0000] TSTENV = stdio
No saved state, selection will be empty
# parser guessed wrong encoding expected 'CP1252' got 'UTF-8'
# Will use Digest​::MD5
Can't cd to .. from ./for_find_taint/fa_taint/fab/faba​: No such file or
directory at
/usr/home/jkeenan/p5smoke/perl-current/ext/File-Find/../../lib/File/Find.pm
line 470.
# Looks like your test exited with 2 just after 7.

error while running harness target 'test_harness'​: 1 at
/usr/home/jkeenan/p5smoke/lib/Test/Smoke/App/RunSmoke.pm line 118.
[2019-01-07 07​:21​:12+0000]
[2019-01-07 07​:21​:12+0000]
../ext/File-Find/t/find.t...................................FAILED
[2019-01-07 07​:21​:12+0000] Non-zero exit status​: 2
[2019-01-07 07​:21​:12+0000]
../ext/File-Find/t/find.t...................................FAILED
[2019-01-07 07​:21​:12+0000] Bad plan. You planned 238 tests but ran 7.
[2019-01-07 07​:21​:12+0000] Archived results...
#####

I tried reproducing this failure on the same machine with this
configuration​:

#####
export PERLIO="" && sh ./Configure -des -Dusedevel -Duseithreads
-Doptimize="-O2 -pipe -fstack-protector -fno-strict-aliasing" -Dcc="gcc"
-Dusemorebits -DDEBUGGING && make test_harness
#####

I was not surprised that this did not reproduce the failure.

The file which is actually failing in this report is
ext/File-Find/t/find.t. It's failing in this area​:

#####
  93 ##### RT #122547 #####
  94 # Do find() and finddepth() correctly warn on invalid options?
  95 {
  96 my $bad_option = 'foobar';
  97 my $second_bad_option = 'really_foobar';
  98
  99 $​::count_taint = 0;
  100 local $SIG{__WARN__} = sub { $warn_msg = $_[0]; };
  101 {
  102 find(
  103 {
  104 wanted => sub { ++$​::count_taint if $_ eq
'taint.t'; },
  105 $bad_option => undef,
  106 },
  107 File​::Spec->curdir
  108 );
  109 };
  110 like($warn_msg, qr/Invalid option/s, "Got warning for invalid
option");
  111 like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
  112 is($​::count_taint, 1, "count_taint incremented");
  113 undef $warn_msg;
  114
  115 $​::count_taint = 0;
  116 {
  117 finddepth(
  118 {
  119 wanted => sub { ++$​::count_taint if $_ eq
'taint.t'; },
  120 $bad_option => undef,
  121 $second_bad_option => undef,
  122 },
  123 File​::Spec->curdir
  124 );
  125 };
#####

It's failing in the finddepth() call at line 117, i.e., it PASSes all 3
tests after the find() call at line 102.

But the "from" directory in the error message is referring to testing
directories which are only created in the course of running
ext/File-Find/t/taint.t​:

#####
Can't cd to .. from ./for_find_taint/fa_taint/fab/faba​: No such file or
directory at
/usr/home/jkeenan/p5smoke/perl-current/ext/File-Find/../../lib/File/Find.pm
line 470.
#####
$ ack for_find_taint ext/File-Find
ext/File-Find/t/taint.t
88​: if (-d dir_path('for_find_taint')) {
89​: $need_updir = 1 if chdir(dir_path('for_find_taint'));
110​: if (-d dir_path('for_find_taint')) {
111​: rmdir dir_path('for_find_taint') or print "# Can't rmdir
for_find_taint​: $!\n";
160​:mkdir_ok( dir_path('for_find_taint'), 0770 );
161​:ok( chdir( dir_path('for_find_taint')), 'successful chdir() to
for_find_taint' );
#####

By implication, the failure in find.t is occurring because testing
directories created while running taint.t are still in existence.

In the smoke-me/jkeenan/test-file-find-serially branch I placed
'ext/File-Find/t' in the same list of directories within 't/harness'
that guarantees that 'ext/Pod-Html/t' and 'cpan/IO-Zlib/t' to not be
tested in parallel. With this change I got satisfactory results from
our smoke-testers, i.e., no run failed due to the intermittent error in
'ext/File-Find/t/find.t'. I therefore recommend applying the patch
attached to blead (and I will do so within 3 days unless we get a strong
objection).

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Jan 15, 2019

From @jkeenan

0001-Do-not-test-ext-File-Find-t-.t-files-in-parallel.patch
From 3cfb5c799c5af768855bd06d71cc73029fe0b2a8 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Wed, 9 Jan 2019 12:51:38 -0500
Subject: [PATCH] Do not test ext/File-Find/t/*.t files in parallel.

Smoke test reports suggest that files and directories which are being
created temporarily for testing purposes in t/taint.t are being seen by
finddepth() while the harness is running t/find.t.
---
 t/harness | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/t/harness b/t/harness
index caa2a318b8..3b9f7488df 100644
--- a/t/harness
+++ b/t/harness
@@ -189,7 +189,11 @@ if (@ARGV) {
         # directory containing such files should be tested in serial order.
         #
         # Add exceptions to the above rule
-        for (qw(ext/Pod-Html/t cpan/IO-Zlib/t)) {
+        for (qw(
+                ext/Pod-Html/t
+                cpan/IO-Zlib/t
+                ext/File-Find/t
+        )) {
             $serials{$_} = 1;
         }
 
-- 
2.17.1

@p5pRT
Copy link
Author

p5pRT commented Jan 16, 2019

From @iabyn

On Tue, Jan 15, 2019 at 01​:05​:23PM -0800, James E Keenan (via RT) wrote​:

Smoke test reports suggest that files and directories which are being
created temporarily for testing purposes in t/taint.t are being seen by
finddepth() while the harness is running t/find.t.
---
t/harness | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/t/harness b/t/harness
index caa2a318b8..3b9f7488df 100644
--- a/t/harness
+++ b/t/harness
@​@​ -189,7 +189,11 @​@​ if (@​ARGV) {
# directory containing such files should be tested in serial order.
#
# Add exceptions to the above rule
- for (qw(ext/Pod-Html/t cpan/IO-Zlib/t)) {
+ for (qw(
+ ext/Pod-Html/t
+ cpan/IO-Zlib/t
+ ext/File-Find/t
+ )) {
$serials{$_} = 1;

Surely it would be far better to make find.t parallel-run-safe rather than
adding to the list of exceptions.

From a brief visual inspection of find.t, it seems that it generally
creates aclean subdirectory to safely run the tests in, *except* for the
tests for RT #122547 which check for running find with invalid args.
It looks like its those test which are failing. So I would guess that
moving those tests to after the first chdir would make them safe.

--
Spock (or Data) is fired from his high-ranking position for not being able
to understand the most basic nuances of about one in three sentences that
anyone says to him.
  -- Things That Never Happen in "Star Trek" #19

@p5pRT
Copy link
Author

p5pRT commented Jan 16, 2019

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

@p5pRT
Copy link
Author

p5pRT commented Jan 16, 2019

From @jkeenan

On Wed, 16 Jan 2019 11​:23​:21 GMT, davem wrote​:

On Tue, Jan 15, 2019 at 01​:05​:23PM -0800, James E Keenan (via RT)
wrote​:

Smoke test reports suggest that files and directories which are being
created temporarily for testing purposes in t/taint.t are being seen
by
finddepth() while the harness is running t/find.t.
---
t/harness | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/t/harness b/t/harness
index caa2a318b8..3b9f7488df 100644
--- a/t/harness
+++ b/t/harness
@​@​ -189,7 +189,11 @​@​ if (@​ARGV) {
# directory containing such files should be tested in serial
order.
#
# Add exceptions to the above rule
- for (qw(ext/Pod-Html/t cpan/IO-Zlib/t)) {
+ for (qw(
+ ext/Pod-Html/t
+ cpan/IO-Zlib/t
+ ext/File-Find/t
+ )) {
$serials{$_} = 1;

Surely it would be far better to make find.t parallel-run-safe rather
than
adding to the list of exceptions.

From a brief visual inspection of find.t, it seems that it generally
creates aclean subdirectory to safely run the tests in, *except* for
the
tests for RT #122547 which check for running find with invalid args.
It looks like its those test which are failing. So I would guess that
moving those tests to after the first chdir would make them safe.

Please review the patch attached, which is available for smoke testing in the following branch​:

smoke-me/jkeenan/133771-repair-file-find-tests

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jan 16, 2019

From @jkeenan

0001-find.t-Use-temporary-testing-directory-for-all-block.patch
From d754d1a80a3b7fd9e5b315e97226f82cfcde2107 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Wed, 16 Jan 2019 10:56:44 -0500
Subject: [PATCH] find.t: Use temporary testing directory for all blocks of
 tests.

During the execution of ext/File-Find/t/taint.t certain files and directories
are created.  As inferred from smoke-test reports, when testing in parallel
these entities ran the risk of being detected by certain tests in
ext/File-Find/t/find.t, thereby causing intermittent failures in the smoke
tests.

Problem is being addressed by moving the block of tests created in August 2014
(RT #122547) to prevent processing of misspelled options to a place in the
file where we have moved from the current working directory one level down to
a temporary testing directory (hence the change from File::Spec->curdir to
File::Spec->updir).

For: RT # 133771
---
 ext/File-Find/t/find.t | 84 ++++++++++++++++++++++--------------------
 1 file changed, 44 insertions(+), 40 deletions(-)

diff --git a/ext/File-Find/t/find.t b/ext/File-Find/t/find.t
index b532752a5a..297d0580e0 100644
--- a/ext/File-Find/t/find.t
+++ b/ext/File-Find/t/find.t
@@ -90,46 +90,6 @@ finddepth({wanted => sub { ++$::count_taint if $_ eq 'taint.t'; } },
     File::Spec->curdir);
 is($::count_taint, 1, "'finddepth' found exactly 1 file named 'taint.t'");
 
-##### RT #122547 #####
-# Do find() and finddepth() correctly warn on invalid options?
-{
-    my $bad_option = 'foobar';
-    my $second_bad_option = 'really_foobar';
-
-    $::count_taint = 0;
-    local $SIG{__WARN__} = sub { $warn_msg = $_[0]; };
-    {
-        find(
-            {
-                wanted => sub { ++$::count_taint if $_ eq 'taint.t'; },
-                $bad_option => undef,
-            },
-            File::Spec->curdir
-        );
-    };
-    like($warn_msg, qr/Invalid option/s, "Got warning for invalid option");
-    like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
-    is($::count_taint, 1, "count_taint incremented");
-    undef $warn_msg;
-
-    $::count_taint = 0;
-    {
-        finddepth(
-            {
-                wanted => sub { ++$::count_taint if $_ eq 'taint.t'; },
-                $bad_option => undef,
-                $second_bad_option => undef,
-            },
-            File::Spec->curdir
-        );
-    };
-    like($warn_msg, qr/Invalid option/s, "Got warning for invalid option");
-    like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
-    like($warn_msg, qr/$second_bad_option/s, "Got warning for $second_bad_option");
-    is($::count_taint, 1, "count_taint incremented");
-    undef $warn_msg;
-}
-
 my $FastFileTests_OK = 0;
 
 sub cleanup {
@@ -300,6 +260,50 @@ create_file_ok( file_path('fa', 'fab', 'fab_ord') );
 mkdir_ok( dir_path('fa', 'fab', 'faba'), 0770  );
 create_file_ok( file_path('fa', 'fab', 'faba', 'faba_ord') );
 
+##### RT #122547 #####
+# Do find() and finddepth() correctly warn on invalid options?
+##### RT #133771 #####
+# When running tests in parallel, avoid clash with tests in
+# ext/File-Find/t/taint by moving into the temporary testing directory
+# before testing for warnings on invalid options.
+{
+    my $bad_option = 'foobar';
+    my $second_bad_option = 'really_foobar';
+
+    $::count_taint = 0;
+    local $SIG{__WARN__} = sub { $warn_msg = $_[0]; };
+    {
+        find(
+            {
+                wanted => sub { ++$::count_taint if $_ eq 'taint.t'; },
+                $bad_option => undef,
+            },
+            File::Spec->updir
+        );
+    };
+    like($warn_msg, qr/Invalid option/s, "Got warning for invalid option");
+    like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
+    is($::count_taint, 1, "count_taint incremented");
+    undef $warn_msg;
+
+    $::count_taint = 0;
+    {
+        finddepth(
+            {
+                wanted => sub { ++$::count_taint if $_ eq 'taint.t'; },
+                $bad_option => undef,
+                $second_bad_option => undef,
+            },
+            File::Spec->updir
+        );
+    };
+    like($warn_msg, qr/Invalid option/s, "Got warning for invalid option");
+    like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
+    like($warn_msg, qr/$second_bad_option/s, "Got warning for $second_bad_option");
+    is($::count_taint, 1, "count_taint incremented");
+    undef $warn_msg;
+}
+
 ##### Basic tests for find() #####
 # Set up list of files we expect to find.
 # Run find(), removing a file from the list once we have found it.
-- 
2.17.1

@p5pRT
Copy link
Author

p5pRT commented Jan 16, 2019

From @tonycoz

On Wed, 16 Jan 2019 07​:59​:39 -0800, jkeenan wrote​:

On Wed, 16 Jan 2019 11​:23​:21 GMT, davem wrote​:

From a brief visual inspection of find.t, it seems that it generally
creates aclean subdirectory to safely run the tests in, *except* for
the
tests for RT #122547 which check for running find with invalid args.
It looks like its those test which are failing. So I would guess that
moving those tests to after the first chdir would make them safe.

Please review the patch attached, which is available for smoke testing
in the following branch​:

smoke-me/jkeenan/133771-repair-file-find-tests

I don't think the patch is correct.

The problem is caused by a race between Find​::Find called by find.t trying to search the t/fa_taint/... directory tree while taint.t is removing it.

Since with your change find.t will still try to search everything under t, including fa_taint, you're still going to get races.

The fix is to move the search as Dave suggested, but to search within the t/for_find tree that find.t controls instead of everything under t/.

The test code will need to be updated to search for something other than taint.t.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jan 17, 2019

From @jkeenan

On Wed, 16 Jan 2019 23​:04​:01 GMT, tonyc wrote​:

On Wed, 16 Jan 2019 07​:59​:39 -0800, jkeenan wrote​:

On Wed, 16 Jan 2019 11​:23​:21 GMT, davem wrote​:

From a brief visual inspection of find.t, it seems that it
generally
creates aclean subdirectory to safely run the tests in, *except*
for
the
tests for RT #122547 which check for running find with invalid
args.
It looks like its those test which are failing. So I would guess
that
moving those tests to after the first chdir would make them safe.

Please review the patch attached, which is available for smoke
testing
in the following branch​:

smoke-me/jkeenan/133771-repair-file-find-tests

I don't think the patch is correct.

The problem is caused by a race between Find​::Find called by find.t
trying to search the t/fa_taint/... directory tree while taint.t is
removing it.

Since with your change find.t will still try to search everything
under t, including fa_taint, you're still going to get races.

The fix is to move the search as Dave suggested, but to search within
the t/for_find tree that find.t controls instead of everything under
t/.

The test code will need to be updated to search for something other
than taint.t.

Tony

Let me pose this question​: Would we be better off using File​::Spec->tmpdir() to create the top-level of the testing directories, then creating for_find/ underneath that directory (in most cases, /tmp)?

We're already using File​::Spec in the find.t, so we would not be adding a dependency. (I want to avoid File​::Temp​::tempdir() for that reason.)

Thank you very much.

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

@p5pRT
Copy link
Author

p5pRT commented Jan 18, 2019

From @tonycoz

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan via RT wrote​:

Let me pose this question​: Would we be better off using File​::Spec->tmpdir() to create the top-level of the testing directories, then creating for_find/ underneath that directory (in most cases, /tmp)?

I don't think it will make a difference over just searching within t/for_find.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2019

From @jkeenan

On Fri, 18 Jan 2019 02​:55​:24 GMT, tonyc wrote​:

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan via RT wrote​:

Let me pose this question​: Would we be better off using File​::Spec-

tmpdir() to create the top-level of the testing directories, then
creating for_find/ underneath that directory (in most cases, /tmp)?

I don't think it will make a difference over just searching within
t/for_find.

Tony

Please review patch 0001-find.t-Use-temporary-testing-directory-for-all-block.201901211500.patch, attached.

Smoke-testing in this branch​:
smoke-me/jkeenan/133771-repair-file-find-tests

Thank you very much.

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

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2019

From @jkeenan

0001-find.t-Use-temporary-testing-directory-for-all-block.201901211500.patch
From a89df5e81b3b0903bcde25fad6a193fdf754d726 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Wed, 16 Jan 2019 10:56:44 -0500
Subject: [PATCH] find.t: Use temporary testing directory for all blocks of
 tests.

During the execution of ext/File-Find/t/taint.t certain files and directories
are created.  As inferred from smoke-test reports, when testing in parallel
these entities ran the risk of being detected by certain tests in
ext/File-Find/t/find.t, thereby causing intermittent failures in the smoke
tests.

Problem is being addressed by (a) moving the block of tests created in August 2014
(RT #122547) to prevent processing of misspelled options to a place in the
file where we have moved from the current working directory one level down to
a temporary testing directory; and (b) providing a list of basenames of files
we expect to find therewithin.
---
 ext/File-Find/t/find.t | 102 ++++++++++++++++++++++-------------------
 1 file changed, 56 insertions(+), 46 deletions(-)

diff --git a/ext/File-Find/t/find.t b/ext/File-Find/t/find.t
index b532752a5a..b0e30eb478 100644
--- a/ext/File-Find/t/find.t
+++ b/ext/File-Find/t/find.t
@@ -90,46 +90,6 @@ finddepth({wanted => sub { ++$::count_taint if $_ eq 'taint.t'; } },
     File::Spec->curdir);
 is($::count_taint, 1, "'finddepth' found exactly 1 file named 'taint.t'");
 
-##### RT #122547 #####
-# Do find() and finddepth() correctly warn on invalid options?
-{
-    my $bad_option = 'foobar';
-    my $second_bad_option = 'really_foobar';
-
-    $::count_taint = 0;
-    local $SIG{__WARN__} = sub { $warn_msg = $_[0]; };
-    {
-        find(
-            {
-                wanted => sub { ++$::count_taint if $_ eq 'taint.t'; },
-                $bad_option => undef,
-            },
-            File::Spec->curdir
-        );
-    };
-    like($warn_msg, qr/Invalid option/s, "Got warning for invalid option");
-    like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
-    is($::count_taint, 1, "count_taint incremented");
-    undef $warn_msg;
-
-    $::count_taint = 0;
-    {
-        finddepth(
-            {
-                wanted => sub { ++$::count_taint if $_ eq 'taint.t'; },
-                $bad_option => undef,
-                $second_bad_option => undef,
-            },
-            File::Spec->curdir
-        );
-    };
-    like($warn_msg, qr/Invalid option/s, "Got warning for invalid option");
-    like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
-    like($warn_msg, qr/$second_bad_option/s, "Got warning for $second_bad_option");
-    is($::count_taint, 1, "count_taint incremented");
-    undef $warn_msg;
-}
-
 my $FastFileTests_OK = 0;
 
 sub cleanup {
@@ -283,22 +243,72 @@ sub my_postprocess {
 mkdir_ok( dir_path('for_find'), 0770 );
 ok( chdir( dir_path('for_find')), "Able to chdir to 'for_find'")
     or die("Unable to chdir to 'for_find'");
+
+my @testing_basenames = ( qw| fb_ord fba_ord fa_ord faa_ord fab_ord faba_ord | );
+
 mkdir_ok( dir_path('fa'), 0770 );
 mkdir_ok( dir_path('fb'), 0770  );
-create_file_ok( file_path('fb', 'fb_ord') );
+create_file_ok( file_path('fb', $testing_basenames[0]) );
 mkdir_ok( dir_path('fb', 'fba'), 0770  );
-create_file_ok( file_path('fb', 'fba', 'fba_ord') );
+create_file_ok( file_path('fb', 'fba', $testing_basenames[1]) );
 if ($symlink_exists) {
     symlink_ok('../fb','fa/fsl');
 }
-create_file_ok( file_path('fa', 'fa_ord') );
+create_file_ok( file_path('fa', $testing_basenames[2]) );
 
 mkdir_ok( dir_path('fa', 'faa'), 0770  );
-create_file_ok( file_path('fa', 'faa', 'faa_ord') );
+create_file_ok( file_path('fa', 'faa', $testing_basenames[3]) );
 mkdir_ok( dir_path('fa', 'fab'), 0770  );
-create_file_ok( file_path('fa', 'fab', 'fab_ord') );
+create_file_ok( file_path('fa', 'fab', $testing_basenames[4]) );
 mkdir_ok( dir_path('fa', 'fab', 'faba'), 0770  );
-create_file_ok( file_path('fa', 'fab', 'faba', 'faba_ord') );
+create_file_ok( file_path('fa', 'fab', 'faba', $testing_basenames[5]) );
+
+##### RT #122547 #####
+# Do find() and finddepth() correctly warn on invalid options?
+##### RT #133771 #####
+# When running tests in parallel, avoid clash with tests in
+# ext/File-Find/t/taint by moving into the temporary testing directory
+# before testing for warnings on invalid options.
+
+my %tb = map { $_ => 1 } @testing_basenames;
+
+{
+    my $bad_option = 'foobar';
+    my $second_bad_option = 'really_foobar';
+
+    $::count_tb = 0;
+    local $SIG{__WARN__} = sub { $warn_msg = $_[0]; };
+    {
+        find(
+            {
+                wanted => sub { ++$::count_tb if $tb{$_}; },
+                $bad_option => undef,
+            },
+            File::Spec->curdir
+        );
+    };
+    like($warn_msg, qr/Invalid option/s, "Got warning for invalid option");
+    like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
+    is($::count_tb, scalar(@testing_basenames), "count_tb incremented");
+    undef $warn_msg;
+
+    $::count_tb = 0;
+    {
+        finddepth(
+            {
+                wanted => sub { ++$::count_tb if $tb{$_}; },
+                $bad_option => undef,
+                $second_bad_option => undef,
+            },
+            File::Spec->curdir
+        );
+    };
+    like($warn_msg, qr/Invalid option/s, "Got warning for invalid option");
+    like($warn_msg, qr/$bad_option/s, "Got warning for $bad_option");
+    like($warn_msg, qr/$second_bad_option/s, "Got warning for $second_bad_option");
+    is($::count_tb, scalar(@testing_basenames), "count_tb incremented");
+    undef $warn_msg;
+}
 
 ##### Basic tests for find() #####
 # Set up list of files we expect to find.
-- 
2.17.1

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2019

From @tonycoz

On Mon, 21 Jan 2019 12​:09​:17 -0800, jkeenan wrote​:

On Fri, 18 Jan 2019 02​:55​:24 GMT, tonyc wrote​:

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan via RT
wrote​:

Let me pose this question​: Would we be better off using
File​::Spec-

tmpdir() to create the top-level of the testing directories, then
creating for_find/ underneath that directory (in most cases, /tmp)?

I don't think it will make a difference over just searching within
t/for_find.

Tony

Please review patch 0001-find.t-Use-temporary-testing-directory-for-
all-block.201901211500.patch, attached.

That looks better.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jan 23, 2019

From @jkeenan

On Mon, 21 Jan 2019 22​:52​:57 GMT, tonyc wrote​:

On Mon, 21 Jan 2019 12​:09​:17 -0800, jkeenan wrote​:

On Fri, 18 Jan 2019 02​:55​:24 GMT, tonyc wrote​:

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan via RT
wrote​:

Let me pose this question​: Would we be better off using
File​::Spec-

tmpdir() to create the top-level of the testing directories, then
creating for_find/ underneath that directory (in most cases, /tmp)?

I don't think it will make a difference over just searching within
t/for_find.

Tony

Please review patch 0001-find.t-Use-temporary-testing-directory-for-
all-block.201901211500.patch, attached.

That looks better.

Tony

Merged to blead in commit 0abd162. Will monitor ticket for several days before closing.

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jan 28, 2019

From @jkeenan

On Wed, 23 Jan 2019 20​:24​:27 GMT, jkeenan wrote​:

On Mon, 21 Jan 2019 22​:52​:57 GMT, tonyc wrote​:

On Mon, 21 Jan 2019 12​:09​:17 -0800, jkeenan wrote​:

On Fri, 18 Jan 2019 02​:55​:24 GMT, tonyc wrote​:

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan via RT
wrote​:

Let me pose this question​: Would we be better off using
File​::Spec-

tmpdir() to create the top-level of the testing directories,
then
creating for_find/ underneath that directory (in most cases,
/tmp)?

I don't think it will make a difference over just searching
within
t/for_find.

Tony

Please review patch 0001-find.t-Use-temporary-testing-directory-
for-
all-block.201901211500.patch, attached.

That looks better.

Tony

Merged to blead in commit 0abd162.
Will monitor ticket for several days before closing.

Thank you very much.

Unfortunately, we don't have the problem licked. See this smoke-test report​:

http​://perl5.test-smoke.org/report/79324

#####
Test failures​:
~~ ../ext/File-Find/t/taint.t .................................. FAILED Non-zero exit status​: 2 Bad plan. You planned 45 tests but ran 1.
[stdio] -Duseithreads -Doptimize="-O2 -pipe -fstack-protector -fno-strict-aliasing" -Dcc="gcc" -Duselongdouble DEBUGGING
#####

Here it is taint.t that is experiencing failures; the patch applied dealt with find.t.

I doubt that the particular ./Configure options had anything to do with the failure. The smokecurrent.log didn't have any more information than is visible at the URL cited above.

Needs further investigation.

Thank you very much.

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

@p5pRT
Copy link
Author

p5pRT commented Feb 13, 2019

From @tonycoz

On Mon, 28 Jan 2019 14​:52​:18 -0800, jkeenan wrote​:

On Wed, 23 Jan 2019 20​:24​:27 GMT, jkeenan wrote​:

On Mon, 21 Jan 2019 22​:52​:57 GMT, tonyc wrote​:

On Mon, 21 Jan 2019 12​:09​:17 -0800, jkeenan wrote​:

On Fri, 18 Jan 2019 02​:55​:24 GMT, tonyc wrote​:

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan via RT
wrote​:

Let me pose this question​: Would we be better off using
File​::Spec-

tmpdir() to create the top-level of the testing
directories,
then
creating for_find/ underneath that directory (in most cases,
/tmp)?

I don't think it will make a difference over just searching
within
t/for_find.

Tony

Please review patch 0001-find.t-Use-temporary-testing-directory-
for-
all-block.201901211500.patch, attached.

That looks better.

Tony

Merged to blead in commit 0abd162.
Will monitor ticket for several days before closing.

Thank you very much.

Unfortunately, we don't have the problem licked. See this smoke-test
report​:

http​://perl5.test-smoke.org/report/79324

#####
Test failures​:
~~ ../ext/File-Find/t/taint.t ..................................
FAILED Non-zero exit status​: 2 Bad plan. You planned 45 tests but ran
1.
[stdio] -Duseithreads -Doptimize="-O2 -pipe -fstack-protector -fno-
strict-aliasing" -Dcc="gcc" -Duselongdouble DEBUGGING
#####

Here it is taint.t that is experiencing failures; the patch applied
dealt with find.t.

I doubt that the particular ./Configure options had anything to do
with the failure. The smokecurrent.log didn't have any more
information than is visible at the URL cited above.

Needs further investigation.

Thank you very much.

Has this happened again since then?

It might be due to something unrelated.

Tony

@p5pRT
Copy link
Author

p5pRT commented Mar 12, 2019

From @jkeenan

On Wed, 13 Feb 2019 23​:38​:55 GMT, tonyc wrote​:

On Mon, 28 Jan 2019 14​:52​:18 -0800, jkeenan wrote​:

On Wed, 23 Jan 2019 20​:24​:27 GMT, jkeenan wrote​:

On Mon, 21 Jan 2019 22​:52​:57 GMT, tonyc wrote​:

On Mon, 21 Jan 2019 12​:09​:17 -0800, jkeenan wrote​:

On Fri, 18 Jan 2019 02​:55​:24 GMT, tonyc wrote​:

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan via RT
wrote​:

Let me pose this question​: Would we be better off using
File​::Spec-

tmpdir() to create the top-level of the testing
directories,
then
creating for_find/ underneath that directory (in most cases,
/tmp)?

I don't think it will make a difference over just searching
within
t/for_find.

Tony

Please review patch 0001-find.t-Use-temporary-testing-directory-
for-
all-block.201901211500.patch, attached.

That looks better.

Tony

Merged to blead in commit 0abd162.
Will monitor ticket for several days before closing.

Thank you very much.

Unfortunately, we don't have the problem licked. See this smoke-test
report​:

http​://perl5.test-smoke.org/report/79324

#####
Test failures​:
~~ ../ext/File-Find/t/taint.t ..................................
FAILED Non-zero exit status​: 2 Bad plan. You planned 45 tests but ran
1.
[stdio] -Duseithreads -Doptimize="-O2 -pipe -fstack-protector -fno-
strict-aliasing" -Dcc="gcc" -Duselongdouble DEBUGGING
#####

Here it is taint.t that is experiencing failures; the patch applied
dealt with find.t.

I doubt that the particular ./Configure options had anything to do
with the failure. The smokecurrent.log didn't have any more
information than is visible at the URL cited above.

Needs further investigation.

Thank you very much.

Has this happened again since then?

It might be due to something unrelated.

Tony

See http​://perl5.test-smoke.org/report/81935

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

@p5pRT
Copy link
Author

p5pRT commented Mar 14, 2019

From @jkeenan

On Tue, 12 Mar 2019 16​:19​:57 GMT, jkeenan wrote​:
[snip]

See http​://perl5.test-smoke.org/report/81935

Also​: http​://perl5.test-smoke.org/report/82348

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

@p5pRT
Copy link
Author

p5pRT commented Aug 7, 2019

From @jkeenan

On Wed, 13 Feb 2019 23​:38​:55 GMT, tonyc wrote​:

On Mon, 28 Jan 2019 14​:52​:18 -0800, jkeenan wrote​:

On Wed, 23 Jan 2019 20​:24​:27 GMT, jkeenan wrote​:

On Mon, 21 Jan 2019 22​:52​:57 GMT, tonyc wrote​:

On Mon, 21 Jan 2019 12​:09​:17 -0800, jkeenan wrote​:

On Fri, 18 Jan 2019 02​:55​:24 GMT, tonyc wrote​:

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan via RT
wrote​:

Let me pose this question​: Would we be better off using
File​::Spec-

tmpdir() to create the top-level of the testing
directories,
then
creating for_find/ underneath that directory (in most cases,
/tmp)?

I don't think it will make a difference over just searching
within
t/for_find.

Tony

Please review patch 0001-find.t-Use-temporary-testing-directory-
for-
all-block.201901211500.patch, attached.

That looks better.

Tony

Merged to blead in commit 0abd162.
Will monitor ticket for several days before closing.

Thank you very much.

Unfortunately, we don't have the problem licked. See this smoke-test
report​:

http​://perl5.test-smoke.org/report/79324

#####
Test failures​:
~~ ../ext/File-Find/t/taint.t ..................................
FAILED Non-zero exit status​: 2 Bad plan. You planned 45 tests but ran
1.
[stdio] -Duseithreads -Doptimize="-O2 -pipe -fstack-protector -fno-
strict-aliasing" -Dcc="gcc" -Duselongdouble DEBUGGING
#####

Here it is taint.t that is experiencing failures; the patch applied
dealt with find.t.

I doubt that the particular ./Configure options had anything to do
with the failure. The smokecurrent.log didn't have any more
information than is visible at the URL cited above.

Needs further investigation.

Thank you very much.

Has this happened again since then?

It might be due to something unrelated.

Tony

See​: http​://perl5.test-smoke.org/submatrix?test=../ext/File-Find/t/taint.t

The failures from FreeBSD-11 are on the host where I smoke-test blead. In my most frequently used configuration on that host, perl is configured, built and tested 36 times. I get 1 or 2 instances of the failure in taint.t every 2 or 3 smoke-test runs.

I have stared at the relevant code off and on for months, but since I have no reliable way of generating the race condition, I can't test any insights that I might have.

I think we would be better off (where "better off" means getting us to the point where we can close this ticket) simply restoring ext/File-Find/t to the list of directories which are tested in series (currently at line 192 of t/harness).

Please review the patch attached.

Thank you very much.

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

@p5pRT
Copy link
Author

p5pRT commented Aug 7, 2019

From @jkeenan

0001-Run-tests-in-ext-File-Find-t-in-series.patch
From 48e29007b910dd740fd967de95acadd7d522e71a Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Wed, 7 Aug 2019 09:39:56 -0400
Subject: [PATCH] Run tests in ext/File-Find/t in series

For: RT # 133771
---
 t/harness | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/harness b/t/harness
index caa2a318b8..b9857fa022 100644
--- a/t/harness
+++ b/t/harness
@@ -189,7 +189,7 @@ if (@ARGV) {
         # directory containing such files should be tested in serial order.
         #
         # Add exceptions to the above rule
-        for (qw(ext/Pod-Html/t cpan/IO-Zlib/t)) {
+        for (qw(ext/Pod-Html/t cpan/IO-Zlib/t ext/File-Find/t)) {
             $serials{$_} = 1;
         }
 
-- 
2.17.1

@p5pRT
Copy link
Author

p5pRT commented Aug 12, 2019

From @jkeenan

On Wed, 07 Aug 2019 13​:41​:57 GMT, jkeenan wrote​:

On Wed, 13 Feb 2019 23​:38​:55 GMT, tonyc wrote​:

On Mon, 28 Jan 2019 14​:52​:18 -0800, jkeenan wrote​:

On Wed, 23 Jan 2019 20​:24​:27 GMT, jkeenan wrote​:

On Mon, 21 Jan 2019 22​:52​:57 GMT, tonyc wrote​:

On Mon, 21 Jan 2019 12​:09​:17 -0800, jkeenan wrote​:

On Fri, 18 Jan 2019 02​:55​:24 GMT, tonyc wrote​:

On Thu, Jan 17, 2019 at 05​:02​:29AM -0800, James E Keenan
via RT
wrote​:

Let me pose this question​: Would we be better off using
File​::Spec-

tmpdir() to create the top-level of the testing
directories,
then
creating for_find/ underneath that directory (in most
cases,
/tmp)?

I don't think it will make a difference over just searching
within
t/for_find.

Tony

Please review patch 0001-find.t-Use-temporary-testing-
directory-
for-
all-block.201901211500.patch, attached.

That looks better.

Tony

Merged to blead in commit
0abd162.
Will monitor ticket for several days before closing.

Thank you very much.

Unfortunately, we don't have the problem licked. See this smoke-
test
report​:

http​://perl5.test-smoke.org/report/79324

#####
Test failures​:
~~ ../ext/File-Find/t/taint.t ..................................
FAILED Non-zero exit status​: 2 Bad plan. You planned 45 tests but
ran
1.
[stdio] -Duseithreads -Doptimize="-O2 -pipe -fstack-protector -fno-
strict-aliasing" -Dcc="gcc" -Duselongdouble DEBUGGING
#####

Here it is taint.t that is experiencing failures; the patch applied
dealt with find.t.

I doubt that the particular ./Configure options had anything to do
with the failure. The smokecurrent.log didn't have any more
information than is visible at the URL cited above.

Needs further investigation.

Thank you very much.

Has this happened again since then?

It might be due to something unrelated.

Tony

See​: http​://perl5.test-smoke.org/submatrix?test=../ext/File-
Find/t/taint.t

The failures from FreeBSD-11 are on the host where I smoke-test blead.
In my most frequently used configuration on that host, perl is
configured, built and tested 36 times. I get 1 or 2 instances of the
failure in taint.t every 2 or 3 smoke-test runs.

I have stared at the relevant code off and on for months, but since I
have no reliable way of generating the race condition, I can't test
any insights that I might have.

I think we would be better off (where "better off" means getting us to
the point where we can close this ticket) simply restoring ext/File-
Find/t to the list of directories which are tested in series
(currently at line 192 of t/harness).

Please review the patch attached.

Thank you very much.

Hearing no objection, pushed to blead in commit 665ac6a.

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Aug 12, 2019

@jkeenan - Status changed from 'open' to 'pending release'

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

No branches or pull requests

1 participant