+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 {
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();
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;