summaryrefslogtreecommitdiff
path: root/lib/DirHandle.t
diff options
context:
space:
mode:
authorBram <perl-rt@wizbit.be>2008-08-10 22:36:27 +0200
committerNicholas Clark <nick@ccl4.org>2008-08-10 20:43:06 +0000
commitffe4764e6903def60304ff584612fb863707cd05 (patch)
treefacd2987a19343a2f204acbda30afe3a6e2d263a /lib/DirHandle.t
parenta13fba344ba4e4964ffc44249a610a56dd386eff (diff)
downloadperl-ffe4764e6903def60304ff584612fb863707cd05.tar.gz
Avoid a potential testing race condition in lib/Dirhandle.ttest.
Message-ID: <20080810203627.vj786wb688skc44w@horde.wizbit.be> Date: Sun, 10 Aug 2008 20:36:27 +0200 p4raw-id: //depot/perl@34196
Diffstat (limited to 'lib/DirHandle.t')
-rwxr-xr-xlib/DirHandle.t13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/DirHandle.t b/lib/DirHandle.t
index b654f6d384..35a7ea86c3 100755
--- a/lib/DirHandle.t
+++ b/lib/DirHandle.t
@@ -15,6 +15,15 @@ require './test.pl';
plan(5);
+# Fetching the list of files in two different ways and expecting them
+# to be the same is a race condition when tests are running in parallel.
+# So go somewhere quieter.
+my $chdir;
+if ($ENV{PERL_CORE} && -d 'uni') {
+ chdir 'uni';
+ $chdir++;
+};
+
$dot = new DirHandle ($^O eq 'MacOS' ? ':' : '.');
ok(defined($dot));
@@ -33,3 +42,7 @@ cmp_ok(+(join("\0", @b), 'eq', join("\0", @c)));
$dot->close;
$dot->rewind;
ok(!defined($dot->read));
+
+if ($chdir) {
+ chdir "..";
+}