This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Conduct tests of IO::Dir in temporary directory
authorJames E Keenan <jkeenan@cpan.org>
Sat, 29 Dec 2018 04:05:19 +0000 (23:05 -0500)
committerJames E Keenan <jkeenan@cpan.org>
Wed, 9 Jan 2019 03:27:03 +0000 (22:27 -0500)
commitcc71f561576b07005ebc202457318f8e923b41b6
tree8e05f7308057a240124b01414ef91288bea97872
parent35ad0133df9b65a4e32f2f07a2a05b387bd79591
Conduct tests of IO::Dir in temporary directory

For RT # 133740:  After the release of perl-5.29.5, smoke tests
intermittently began to report failures in dist/IO/t/io_dir.t.

In preceding  months, similar intermittent failures had been reported
for files testing File::Find (RT 133658) and GDBM_File (RT 133664).  In
those cases the problem was diagnosed as race conditions under parallel
testing where test files and directories were being created in or
underneath the current working directory without resort to tempdirs or
tempfiles.

The testing in dist/IO/t/io_dir.t presumes the existence of a stable set
of files and subdirectories in dist/IO/.  If additional files or
subdirectories are created while this file is being run, that
presumption is no longer met.

The dist/IO/t/ directory was therefore inspected for test files which,
for testing purposes, would create files or directories underneath the
dist/IO/.  The following test files do so:

    io_file.t
    io_linenum.t
    io_taint.t
    io_tell.t
    io_unix.t
    io_utf8argv.t
    io_utf8.t
    io_xs.t

Of the above, only io_xs.t takes the precaution of using
IO::File->new_tmpfile().

Using File::Temp::tempdir in this file should mitigate the problem.

In addition, all tests in io_dir.t now have descriptions.
dist/IO/t/io_dir.t