(travis) Remove makefile fixup, now hardcoded in the subrepo
[dbsrgits/DBIx-Class.git] / t / storage / txn.t
index f8a729f..0edca6c 100644 (file)
@@ -1,10 +1,16 @@
+# Test is sufficiently involved to *want* to run with "maximum paranoia"
+BEGIN { $ENV{DBICTEST_OLD_MRO_SANITY_CHECK_ASSERTIONS} = 1 }
+
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
 use strict;
 use warnings;
 
 use Test::More;
 use Test::Warn;
 use Test::Exception;
-use lib qw(t/lib);
+use Errno ();
+
 use DBICTest;
 
 my $code = sub {
@@ -208,12 +214,11 @@ sub _test_forking_action {
 
   SKIP: for my $count (1 .. 5) {
 
-    skip 'Weird DBI General Protection Faults, skip forking tests (RT#63104)', 5
+    skip 'FIXME: Weird DBI General Protection Faults, skip forking tests (RT#63104)', 5
       if $^O eq 'MSWin32';
 
     my $pid = fork();
     if( ! defined $pid ) {
-
       skip "EAGAIN encountered, your system is likely bogged down: skipping forking test", 1
         if $! == Errno::EAGAIN();
 
@@ -450,9 +455,20 @@ warnings_are {
         die $broken_exception
       });
     })
-  } qr/\QTransaction aborted: $broken_exception. Rollback failed: lost connection to storage at @{[__FILE__]} line $ln\E\n/;  # FIXME wtf - ...\E$/m doesn't work here
+  } qr/\QTransaction aborted: $broken_exception. Rollback failed: DBIx::Class::Storage::DBI::txn_rollback(): lost connection to storage at @{[__FILE__]} line $ln\E\n/;  # FIXME wtf - ...\E$/m doesn't work here
 
   is @w, 1, 'One matching warning only';
+
+  # try the same broken exception object, but have exception_action inject it
+  $s->exception_action(sub { die $broken_exception });
+  eval {
+    $s->txn_do( sub {
+      die "some string masked away";
+    });
+  };
+  isa_ok $@, 'DBICTest::BrokenOverload', 'Deficient exception properly propagated';
+
+  is @w, 2, 'The warning was emitted a second time';
 }
 
 done_testing;