Fix intermittent failures in the LeakTracer on 5.18+, remove all workarounds
[dbsrgits/DBIx-Class.git] / t / 52leaks.t
index 80c6cc5..8442db5 100644 (file)
@@ -328,9 +328,6 @@ unless (DBICTest::RunMode->is_plain) {
       ! DBICTest::RunMode->is_plain
         and
       ! $ENV{DBICTEST_IN_PERSISTENT_ENV}
-        and
-      # FIXME - investigate wtf is going on with 5.18
-      ! ( $] > 5.017 and $ENV{DBIC_TRACE_PROFILE} )
     ) {
 
       # FIXME - ideally we should be able to just populate an alternative
@@ -552,7 +549,17 @@ SKIP: {
     @{$persistence_tests->{PPerl}{cmd}}[ 1 .. $#{$persistence_tests->{PPerl}{cmd}} ],
   ];
 
-  require IPC::Open2;
+  # set up -I
+  require Config;
+  $ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC);
+
+  # adjust PATH for -T
+  if (length $ENV{PATH}) {
+    ( $ENV{PATH} ) = join ( $Config::Config{path_sep},
+      map { length($_) ? File::Spec->rel2abs($_) : () }
+        split /\Q$Config::Config{path_sep}/, $ENV{PATH}
+    ) =~ /\A(.+)\z/;
+  }
 
   for my $type (keys %$persistence_tests) { SKIP: {
     unless (eval "require $type") {
@@ -574,6 +581,8 @@ SKIP: {
         if system(@cmd);
     }
 
+    require IPC::Open2;
+
     for (1,2,3) {
       note ("Starting run in persistent env ($type pass $_)");
       IPC::Open2::open2(my $out, undef, @cmd);