Stop loading Time::HiRes in the base test schema - there is no need
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / BaseSchema.pm
index f210c2d..ac3cf8c 100644 (file)
@@ -6,10 +6,9 @@ use warnings;
 use base qw(DBICTest::Base DBIx::Class::Schema);
 
 use Fcntl qw(:DEFAULT :seek :flock);
-use Time::HiRes 'sleep';
 use DBIx::Class::_Util 'scope_guard';
 use DBICTest::Util::LeakTracer qw(populate_weakregistry assert_empty_weakregistry);
-use DBICTest::Util qw( local_umask await_flock dbg DEBUG_TEST_CONCURRENCY_LOCKS );
+use DBICTest::Util qw( local_umask tmpdir await_flock dbg DEBUG_TEST_CONCURRENCY_LOCKS );
 use namespace::clean;
 
 if( $ENV{DBICTEST_ASSERT_NO_SPURIOUS_EXCEPTION_ACTION} ) {
@@ -243,7 +242,7 @@ sub connection {
 
       undef $locker;
 
-      my $lockpath = DBICTest::RunMode->tmpdir->file("_dbictest_$locktype.lock");
+      my $lockpath = tmpdir . "_dbictest_$locktype.lock";
 
       DEBUG_TEST_CONCURRENCY_LOCKS
         and dbg "Waiting for $locktype LOCK: $lockpath...";
@@ -273,7 +272,7 @@ sub connection {
 
         for (1..50) {
           kill (0, $old_pid) or last;
-          sleep 0.1;
+          select( undef, undef, undef, 0.1 );
         }
 
         DEBUG_TEST_CONCURRENCY_LOCKS