From c6eacdc3acc965cb069ded02e066d3c00e9385df Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Wed, 3 Dec 2014 10:53:00 +0000 Subject: 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. --- lib/File/stat.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/File') 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; -- cgit v1.2.1