summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2014-12-03 10:53:00 +0000
committerDavid Mitchell <davem@iabyn.com>2014-12-03 10:53:00 +0000
commitc6eacdc3acc965cb069ded02e066d3c00e9385df (patch)
tree2f87a4ef60b8759702678d6cb5c3654f228a62a6 /lib/File
parent1037353b7e5ab2b2522d601c33d3c548ab4cd100 (diff)
downloadperl-c6eacdc3acc965cb069ded02e066d3c00e9385df.tar.gz
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.
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/stat.t2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/File/stat.t b/lib/File/stat.t
index 264ecd1919..81f75f586c 100644
--- a/lib/File/stat.t
+++ b/lib/File/stat.t
@@ -13,7 +13,7 @@ use File::Temp qw( tempfile tempdir );
use File::stat;
-my (undef, $file) = tempfile();
+my (undef, $file) = tempfile(UNLINK => 1);
{
my @stat = CORE::stat $file;