This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make sure perl doesn't touch stat.t between stats
authorTony Cook <tony@develop-help.com>
Wed, 22 Sep 2010 04:28:36 +0000 (14:28 +1000)
committerTony Cook <tony@develop-help.com>
Wed, 22 Sep 2010 04:28:36 +0000 (14:28 +1000)
commitc69df70ff62392023ac4d1f5d9278c8e64b06369
tree6308c527f7f518e1d59a09a8c703f16f6c495c40
parenta6485a247941d126734ee4585a7e19bf7e31097e
make sure perl doesn't touch stat.t between stats

ebcfa0534 changed stat.t to avoid using TEST as the stat target, since
it is read by other test scripts.  But with the initial stat() in the
BEGIN block perl is still reading the script for compilation, which
will update the access time.  Since the system clock usually didn't
tick another second between the first and second stats, the test
usually succeeded, but occasionally the clock would tick, and the test
would fail.

Moved the stat() out of the BEGIN block to avoid that.

As a check I temporarily added a 2 second sleep after the initial
stat to ensure we didn't have a similar problem to that will
allowed this to pass most of the time.
lib/File/stat.t