From: Paul Mooney Date: Wed, 16 Mar 2016 11:50:33 +0000 (+0000) Subject: Test we do not go into an infinite loop calling svp_release() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fghpr%2Fapplied%2Fas_f5f0cb1d;p=dbsrgits%2FDBIx-Class-Historic.git Test we do not go into an infinite loop calling svp_release() --- diff --git a/t/storage/savepoints.t b/t/storage/savepoints.t index 66b7d71..4a11892 100644 --- a/t/storage/savepoints.t +++ b/t/storage/savepoints.t @@ -247,6 +247,19 @@ SKIP: { undef, 'rollback from inner transaction'; } + # Check we do not go into an infinite loop calling svp_release() with a + # savepoint that is not on the stack + eval { + local $SIG{ALRM} = sub { die "infinite loop\n" }; + alarm 3; + $schema->txn_do(sub { + $schema->svp_release('wibble'); + }); + alarm 0; + }; + my $error = $@; + like $error, 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") });