This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop test suite filling /tmp
authorDavid Mitchell <davem@iabyn.com>
Wed, 3 Dec 2014 10:53:00 +0000 (10:53 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Dec 2014 10:53:00 +0000 (10:53 +0000)
commitc6eacdc3acc965cb069ded02e066d3c00e9385df
tree2f87a4ef60b8759702678d6cb5c3654f228a62a6
parent1037353b7e5ab2b2522d601c33d3c548ab4cd100
Stop test suite filling /tmp

Some test files use File::Temp in such a way that the temporary files and
directories under /tmp aren't deleted at the end. On a smoker system, this
can gradually accumulate thousands of entries under /tmp.

The general culprits fixed by this commit are:

1) using tempfile() without the UNLINK => 1 argument;

2) Using Test::More (which uses Test::Stream), which creates a test
   directory in such a way that only the original parent thread will
   remove it; for some reason I still don't fully understand, detaching a
   thread rather than joining it stops this clean up happening. In the
   affected test files, I replaced the ->detach() with a ->join() just
   before exit, and the problem went away.

Some tests under cpan/ are still leaky; these will be addressed upstream.
dist/Thread-Queue/t/07_lock.t
dist/Thread-Semaphore/t/01_basic.t
dist/Thread-Semaphore/t/04_nonblocking.t
dist/Thread-Semaphore/t/05_force.t
ext/SDBM_File/t/prep.t
lib/File/stat.t