Initial full test pass - all fetches are eager for now
[dbsrgits/DBIx-Class.git] / t / 52leaks.t
index 796453b..e2ed738 100644 (file)
@@ -79,6 +79,10 @@ unless (DBICTest::RunMode->is_plain) {
       }
     );
 
+    # unicode is tricky, and now we happen to invoke it early via a
+    # regex in connection()
+    return $obj if (ref $obj) =~ /^utf8/;
+
     # Test Builder is now making a new object for every pass/fail (que bloat?)
     # and as such we can't really store any of its objects (since it will
     # re-populate the registry while checking it, ewwww!)
@@ -358,6 +362,16 @@ for my $slot (keys %$weak_registry) {
     delete $weak_registry->{$slot}
       unless $cleared->{hash_merge_singleton}{$weak_registry->{$slot}{weakref}{behavior}}++;
   }
+  elsif (
+    $slot =~ /^Data::Dumper/
+      and
+    $weak_registry->{$slot}{stacktrace} =~ /\QDBIx::Class::ResultSource::_mk_row_parser/
+  ) {
+    # there should be only one D::D object (used to construct the rowparser)
+    # more would indicate trouble
+    delete $weak_registry->{$slot}
+      unless $cleared->{mk_row_parser_dd_singleton}++;
+  }
   elsif (DBIx::Class::_ENV_::INVISIBLE_DOLLAR_AT and $slot =~ /^__TxnScopeGuard__FIXUP__/) {
     delete $weak_registry->{$slot}
   }
@@ -418,6 +432,12 @@ assert_empty_weakregistry ($weak_registry);
 # this is ugly and dirty but we do not yet have a Test::Embedded or
 # similar
 
+# set up -I
+require Config;
+$ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC);
+($ENV{PATH}) = $ENV{PATH} =~ /(.+)/;
+
+
 my $persistence_tests = {
   PPerl => {
     cmd => [qw/pperl --prefork=1/, __FILE__],
@@ -442,10 +462,6 @@ SKIP: {
   skip 'Main test failed - skipping persistent env tests', 1
     unless $TB->is_passing;
 
-  # set up -I
-  require Config;
-  local $ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC);
-
   local $ENV{DBICTEST_IN_PERSISTENT_ENV} = 1;
 
   require IPC::Open2;