Reorganize runmode detection a bit
[dbsrgits/DBIx-Class.git] / t / zzzzzzz_sqlite_deadlock.t
index 7bb0fe0..c967c25 100644 (file)
@@ -9,12 +9,22 @@ use File::Temp ();
 use DBICTest;
 use DBICTest::Schema;
 
+if ( DBICTest::RunMode->is_plain ) {
+  plan( skip_all => "Skipping test on plain module install" );
+}
+
 plan tests => 2;
-my $wait_for = 10;  # how many seconds to wait
+my $wait_for = 120;  # how many seconds to wait
 
 for my $close (0,1) {
 
-  my $tmp = File::Temp->new( UNLINK => 1, TMPDIR => 1, SUFFIX => '.sqlite' );
+  my $tmp = File::Temp->new(
+    UNLINK => 1,
+    TMPDIR => 1,
+    SUFFIX => '.sqlite',
+    EXLOCK => 0,  # important for BSD and derivatives
+  );
+
   my $tmp_fn = $tmp->filename;
   close $tmp if $close;
 
@@ -27,9 +37,8 @@ for my $close (0,1) {
 
   lives_ok (sub {
     my $schema = DBICTest::Schema->connect ("DBI:SQLite:$tmp_fn");
-    warn $tmp_fn;
     DBICTest->deploy_schema ($schema);
-    DBICTest->populate_schema ($schema);
+    #DBICTest->populate_schema ($schema);
   });
 
   alarm 0;