-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tie::File: use File::Temp in two test scripts
t/29_downcopy.t and t/29a_upcopy.t intermittently timeout on some smokers. This is speculated to be due to the current directory being on a very slow USB drive, when lots of small test files are created, modified and deleted by these tests. So making these tests I/O bound rather than CPU bound. Update these two test scripts to use File::Temp to create a temp subdir in the OS's normal temp directory as a place for the temp files, rather than just the current directory. This has two potential advantages. First the OS's normal tempdir (e.g. /tmp or wherever $TMPDIR points to) may be mounted as tmpfs or similar, and thus won't actually write to a slow USB or network drive. Second, each test file will be created in directory that's normally empty, so there's potentially less manipulating of the directory information on disk. In this thread, http://nntp.perl.org/group/perl.perl5.porters/267991 the wallclock time taken for 29_downcopy.t on a raspberry pi reduced from 55.29s to 0.91s with the application of this patch.
- Loading branch information
Showing
2 changed files
with
32 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters