[Bast-commits] r6892 - DBIx-Class/0.08/branches/extended_rels/t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Tue Jun 30 17:58:47 GMT 2009


Author: ribasushi
Date: 2009-06-30 17:58:46 +0000 (Tue, 30 Jun 2009)
New Revision: 6892

Added:
   DBIx-Class/0.08/branches/extended_rels/t/zzzzzzz_sqlite_deadlock.t
Log:
Bring test back

Added: DBIx-Class/0.08/branches/extended_rels/t/zzzzzzz_sqlite_deadlock.t
===================================================================
--- DBIx-Class/0.08/branches/extended_rels/t/zzzzzzz_sqlite_deadlock.t	                        (rev 0)
+++ DBIx-Class/0.08/branches/extended_rels/t/zzzzzzz_sqlite_deadlock.t	2009-06-30 17:58:46 UTC (rev 6892)
@@ -0,0 +1,35 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+use lib 't/lib';
+
+use File::Temp ();
+use DBICTest;
+use DBICTest::Schema;
+
+plan tests => 2;
+my $wait_for = 10;  # how many seconds to wait
+
+for my $close (0,1) {
+
+  my $tmp = File::Temp->new( UNLINK => 1, TMPDIR => 1, SUFFIX => '.sqlite' );
+  my $tmp_fn = $tmp->filename;
+  close $tmp if $close;
+
+  local $SIG{ALRM} = sub { die sprintf (
+    "Timeout of %d seconds reached (tempfile still open: %s)",
+    $wait_for, $close ? 'No' : 'Yes'
+  )};
+
+  alarm $wait_for;
+
+  lives_ok (sub {
+    my $schema = DBICTest::Schema->connect ("DBI:SQLite:$tmp_fn");
+    DBICTest->deploy_schema ($schema);
+    DBICTest->populate_schema ($schema);
+  });
+
+  alarm 0;
+}




More information about the Bast-commits mailing list