Skip Menu |
 

This queue is for tickets about the File-Slurp CPAN distribution.

Report information
The Basics
Id: 88968
Status: resolved
Priority: 0/
Queue: File-Slurp

People
Owner: cwhitener [...] gmail.com
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Tests are not parallel-safe ( random failures under HARNESS_OPTIONS=j{x>1} )
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.16-1937-1380135188-113.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1350
Download (untitled) / with headers
text/plain 1.3k
Random example: Running make test PERL_DL_NONLAZY=1 /home/travis/perl5/perlbrew/perls/5.12.4/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/pod.t ............... skipped: Test::Pod 1.14 required for testing POD t/append_null.t ....... ok t/chomp.t ............. ok t/binmode.t ........... ok t/data_list.t ......... ok t/data_scalar.t ....... ok t/inode.t ............. ok read_file 'edit_file_data' - sysopen: No such file or directory at t/edit_file.t line 83. # Looks like you planned 5 tests but ran 3. # Looks like your test exited with 2 just after 3. t/edit_file.t ......... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/5 subtests t/file_object.t ....... ok t/no_clobber.t ........ ok t/pod_coverage.t ...... skipped: Test::Pod::Coverage 1.04 required for testing POD coverage t/error_mode.t ........ ok t/newline.t ........... ok t/error.t ............. ok t/original.t .......... ok t/perms.t ............. ok t/prepend_file.t ...... ok t/pseudo.t ............ ok t/read_dir.t .......... ok t/slurp.t ............. ok t/write_file_win32.t .. ok t/handle.t ............ ok t/paragraph.t ......... ok t/stdin.t ............. ok t/stringify.t ......... ok t/tainted.t ........... ok t/large.t ............. ok t/signal.t ............ ok
MIME-Version: 1.0
In-Reply-To: <rt-4.0.16-1937-1380135188-113.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.16-1937-1380135188-113.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-14369-1406048865-1576.88968-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 180
Download (untitled) / with headers
text/plain 180b
If this distribution is intended to still be in common use, this needs to get fixed. It is getting in the way of many automatic installation systems, requiring manual intervention.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-14369-1406048865-1576.88968-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
X-RT-Interface: Web
References: <rt-4.0.16-1937-1380135188-113.0-0-0 [...] rt.cpan.org> <rt-4.0.18-14369-1406048865-1576.88968-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1441983476-14191-2"
Message-ID: <rt-4.0.18-14191-1441983476-1655.88968-0-0 [...] rt.cpan.org>
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 667
Download (untitled) / with headers
text/plain 667b
I believe the problem is that two tests try to access a temporary file of the same name. For example, tests chomp.t and edit_file.t both access a temporary file named "edit_file_data". Both tests create this file, read it, then delete it. If these two tests are run in parallel, it is possible that one test deletes the temporary file just before the other test tries to read it, resulting in the reported error message. Other tests also access common temporary files ("xxx" and "slurp.data"). The solution is to make sure all tests create uniquely named temporary files. Patches are included for these four test files: chomp.t no_clobber.t paragraph.t slurp.t
MIME-Version: 1.0
Subject: diff-chomp.txt
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Type: text/plain; charset="utf-8"; name="diff-chomp.txt"
Content-Disposition: inline; filename="diff-chomp.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 267
Download diff-chomp.txt
text/plain 267b
--- t/chomp.t 2015-09-11 10:41:18.616762000 -0400 +++ ../File-Slurp-9999.19.orig/t/chomp.t 2011-05-05 01:29:39.000000000 -0400 @@ -9,7 +9,7 @@ use TestDriver ; -my $file = 'chomp_file_data' ; +my $file = 'edit_file_data' ; my $existing_data = <<PRE ; line 1
Subject: diff-noc.txt
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; name="diff-noc.txt"
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline; filename="diff-noc.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 235
Download diff-noc.txt
text/plain 235b
--- t/no_clobber.t 2015-09-11 10:44:08.105884000 -0400 +++ ../File-Slurp-9999.19.orig/t/no_clobber.t 2009-04-30 20:15:00.000000000 -0400 @@ -11,7 +11,7 @@ more text TEXT -my $file = 'xxx2' ; +my $file = 'xxx' ; unlink $file ;
MIME-Version: 1.0
Subject: diff-par.txt
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Type: text/plain; charset="utf-8"; name="diff-par.txt"
Content-Disposition: inline; filename="diff-par.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 267
Download diff-par.txt
text/plain 267b
--- t/paragraph.t 2015-09-11 10:42:05.192249000 -0400 +++ ../File-Slurp-9999.19.orig/t/paragraph.t 2009-04-30 20:15:16.000000000 -0400 @@ -7,7 +7,7 @@ use Carp ; -my $file = 'paragraph_file_data' ; +my $file = 'slurp.data' ; unlink $file ; my @text_data = (
Subject: diff-slurp.txt
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; name="diff-slurp.txt"
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline; filename="diff-slurp.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 270
Download diff-slurp.txt
text/plain 270b
--- t/slurp.t 2015-09-11 10:43:58.553982000 -0400 +++ ../File-Slurp-9999.19.orig/t/slurp.t 2011-03-27 00:45:18.000000000 -0400 @@ -10,7 +10,7 @@ more text TEXT -my $file = 'xxx3' ; +my $file = 'xxx' ; write_file( $file, $data ) ; my $read_buf = slurp( $file ) ;
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-14191-1441983476-1655.88968-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.16-1937-1380135188-113.0-0-0 [...] rt.cpan.org> <rt-4.0.18-14369-1406048865-1576.88968-0-0 [...] rt.cpan.org> <rt-4.0.18-14191-1441983476-1655.88968-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-4795-1442047956-317.88968-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 785
Download (untitled) / with headers
text/plain 785b
On 2015-09-11 10:57:56, GSULLIVAN wrote: Show quoted text
> I believe the problem is that two tests try to access a temporary file > of the > same name. For example, tests chomp.t and edit_file.t both access > a temporary file named "edit_file_data". Both tests create this file, > read it, then delete it. If these two tests are run in parallel, > it is possible that one test deletes the temporary file just before > the > other test tries to read it, resulting in the reported error message. > > Other tests also access common temporary files ("xxx" and > "slurp.data"). > > The solution is to make sure all tests create uniquely named temporary > files. > Patches are included for these four test files: > > chomp.t > no_clobber.t > paragraph.t > slurp.t
It looks like the patch is reversed.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-4795-1442047956-317.88968-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.16-1937-1380135188-113.0-0-0 [...] rt.cpan.org> <rt-4.0.18-14369-1406048865-1576.88968-0-0 [...] rt.cpan.org> <rt-4.0.18-14191-1441983476-1655.88968-0-0 [...] rt.cpan.org> <rt-4.0.18-4795-1442047956-317.88968-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-20950-1442107768-1555.88968-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 127
Download (untitled) / with headers
text/plain 127b
Yep, I botched the file order, but the changes are trivial for whoever will make them (it may even be me, if granted comaint).
MIME-Version: 1.0
In-Reply-To: <rt-4.0.16-1937-1380135188-113.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.16-1937-1380135188-113.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-8577-1538704967-1776.88968-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 284
Download (untitled) / with headers
text/plain 284b
Hi Everyone, We've completely overhauled the test suite and it should now be parallel-safe as it uses proper temp files and we have our CI running tests in parallel (and passing). Version 9999.20_02 is out there. Please let us know if any further issues crop up. Thanks again! Chase


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.