Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

not safe to run under HARNESS_OPTIONS=j10 #12

Closed
kentfredric opened this Issue · 4 comments

2 participants

@kentfredric

It may not be possible to resolve this, depending on how it works, but I figured it better to report it anyway =). At least, a bug saying "no, that isn't expected to work" will exist when somebody goes digging.

PERL_DL_NONLAZY=1 /home/kent/perl5/perlbrew/perls/perl-5.18.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_compile.t .......... ok                                            
t/release-pod-syntax.t .. skipped: these tests are for release candidate testing
t/non_existent_path.t ... ok                                            
===(       4;4  1/2  1/2 )==============================================
#   Failed test at t/rm_create.t line 27.
#                   '/home/kent/.cpanm/work/1371157334.259185/Filesys-Notify-Simple-0.11/t/x/move_create.data'
#     doesn't match '(?^:rm_create\.data)'
t/move.t ................ ok                                            
t/rm_create.t ........... 
#   Failed test at t/rm_create.t line 27.
#                   '/home/kent/.cpanm/work/1371157334.259185/Filesys-Notify-Simple-0.11/t/x/move_create.data'
#     doesn't match '(?^:rm_create\.data)'
# Looks like you failed 2 tests of 2.
t/rm_create.t ........... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests 

Test Summary Report
-------------------
t/rm_create.t         (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2

retry

You can s)kip, r)etry, f)orce install, e)xamine build log, or l)ook ? [s] r    
PERL_DL_NONLAZY=1 /home/kent/perl5/perlbrew/perls/perl-5.18.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_compile.t .......... ok                                            
t/release-pod-syntax.t .. skipped: these tests are for release candidate testing
t/non_existent_path.t ... ok                                            
===(       4;5  1/2  1/2 )==============================================
#   Failed test at t/rm_create.t line 27.
#                   '/home/kent/.cpanm/work/1371157334.259185/Filesys-Notify-Simple-0.11/t/x/move_create.data'
#     doesn't match '(?^:rm_create\.data)'
===(       5;7  1/2  2/2 )==============================================
#   Failed test at t/move.t line 28.
#                   '/home/kent/.cpanm/work/1371157334.259185/Filesys-Notify-Simple-0.11/t/x/rm_create.data'
#     doesn't match '(?^:move_create\.data)'
# Looks like you failed 1 test of 2.
t/move.t ................ Dubious, test returned 1 (wstat 256, 0x100)   
Failed 1/2 subtests 
t/rm_create.t ........... 
#   Failed test at t/rm_create.t line 27.
#                   '/home/kent/.cpanm/work/1371157334.259185/Filesys-Notify-Simple-0.11/t/x/move_create.data'
#     doesn't match '(?^:rm_create\.data)'
# Looks like you failed 2 tests of 2.
t/rm_create.t ........... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests 

Test Summary Report
-------------------
t/move.t              (Wstat: 256 Tests: 2 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
t/rm_create.t         (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2

However, it works fine with j1

PERL_DL_NONLAZY=1 /home/kent/perl5/perlbrew/perls/perl-5.18.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_compile.t .......... ok   
t/move.t ................ ok   
t/non_existent_path.t ... ok   
t/release-pod-syntax.t .. skipped: these tests are for release candidate testing
t/rm_create.t ........... ok   
All tests successful.

Though I suspect the problem is just all the tests are reading/writing the same files from the same directory instead of using a real Tempdir:

use FindBin;

plan tests => 2;

my $w = Filesys::Notify::Simple->new([ "lib", "t" ]);
my $test_file = "$FindBin::Bin/x/move_create.data";
my $test_file_to = "$FindBin::Bin/x/move_create.data.to";
@miyagawa
Owner

Though I suspect the problem is just all the tests are reading/writing the same files from the same directory instead of using a real Tempdir:

Sounds great! Can you make a pull request on it?

@kentfredric

Hrm, have working patch, it just seems however that its slightly more work than needed, because the 2 tests that are both failing were hooked to listen for changes in [ "lib", "t" ], so they both were notified of each others changes, causing a failure. Its easy enough to fix, I just don't understand why they've got the notification so broad to begin with, and I don't want to be breaking the tests in subtle ways.

@miyagawa
Owner

Why not listen for the changes on tempdir then?

@kentfredric

Yeah, I have done that change, because that made sense. It just doesn't make sense why its doing what it already does, and I was wondering if it was doing that for a reason that was beyond me =)

@kentfredric kentfredric referenced this issue from a commit in kentfredric/Filesys-Notify-Simple
@kentfredric kentfredric Support running tests under `HARNESS_OPTIONS=j10`. GH Issue #12.
Previously, all work was done in a scratch dir at

  $DIST/t/x/

And each test was using a notifcation on

  $DIST/lib/
  $DIST/x/

So when each test added new files to scratch dir, all tests listening
for notificaton saw the event, and saw file creations they had not
anticipated.

This patch resolves that by using File::Temp to create a tempdir for
each test, and to only listen on that subdir

  $DIST/lib/
  $DIST/x/{TEMPDIRPREFIX}/
f78b717
@miyagawa miyagawa closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.