X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fsavepoints.t;h=8960a5e5ed38597cf36aa2f4c4b2bc5bbeea64e9;hb=6b44e3b08d4d855e971ccb756fc2038a7cb206cb;hp=66b7d71a40bdb2793c0e2e580e04fc958ae2dafa;hpb=18a2903b824e3d3159836c99c1ab88058537169f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/savepoints.t b/t/storage/savepoints.t index 66b7d71..8960a5e 100644 --- a/t/storage/savepoints.t +++ b/t/storage/savepoints.t @@ -6,8 +6,8 @@ use warnings; use Test::More; use Test::Exception; use DBIx::Class::Optional::Dependencies; -use DBIx::Class::_Util qw(modver_gt_or_eq sigwarn_silencer scope_guard); - +use DBIx::Class::_Util qw(sigwarn_silencer scope_guard); +use Scalar::Util 'weaken'; use DBICTest; @@ -228,15 +228,6 @@ for ('', keys %$env2optdep) { SKIP: { is_deeply( $schema->storage->savepoints, [], 'All savepoints forgotten' ); -SKIP: { - skip "FIXME: Reading inexplicably fails on very old replicated DBD::SQLite<1.33", 1 if ( - $ENV{DBICTEST_VIA_REPLICATED} - and - $prefix eq 'SQLite Internal DB' - and - ! modver_gt_or_eq('DBD::SQLite', '1.33') - ); - ok($ars->search({ name => 'in_outer_transaction' })->first, 'commit from outer transaction'); ok($ars->search({ name => 'in_outer_transaction2' })->first, @@ -246,7 +237,20 @@ SKIP: { is $ars->search({ name => 'in_inner_transaction_rolling_back' })->first, undef, 'rollback from inner transaction'; -} + + # make sure a fresh txn will work after above + $schema->storage->txn_do(sub { ok "noop" } ); + +### Make sure non-existend savepoint release doesn't infloop itself + { + weaken( my $s = $schema ); + + throws_ok { + $s->storage->txn_do(sub { $s->svp_release('wibble') }) + } qr/Savepoint 'wibble' does not exist/, + "Calling svp_release on a non-existant savepoint throws expected error" + ; + } ### cleanupz $schema->storage->dbh_do(sub { $_[1]->do("DROP TABLE artist") }); @@ -255,8 +259,6 @@ SKIP: { done_testing; END { - local $SIG{__WARN__} = sigwarn_silencer( qr/Internal transaction state of handle/ ) - unless modver_gt_or_eq('DBD::SQLite', '1.33'); eval { $schema->storage->dbh_do(sub { $_[1]->do("DROP TABLE artist") }) } if defined $schema; undef $schema; }