X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fzzzzzzz_sqlite_deadlock.t;h=6a38d2c23b4b8ef9e816cc3238d4aebddc123e86;hb=7e1ca6dd06c5e53e7afa3433da0f59e41ce791e8;hp=e48baa25c97dd788ae44d231d8fd14568d7f573b;hpb=f86589ef2338e26895ae618238a609806b57cd4f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/zzzzzzz_sqlite_deadlock.t b/t/zzzzzzz_sqlite_deadlock.t index e48baa2..6a38d2c 100644 --- a/t/zzzzzzz_sqlite_deadlock.t +++ b/t/zzzzzzz_sqlite_deadlock.t @@ -2,22 +2,31 @@ use strict; use warnings; use Test::More; -use Test::Exception; + use lib 't/lib'; +use DBICTest::RunMode; -use File::Temp (); +if ( DBICTest::RunMode->is_plain ) { + plan( skip_all => "Skipping test on plain module install" ); +} + +use Test::Exception; use DBICTest; -use DBICTest::Schema; +use File::Temp (); plan tests => 2; -my $wait_for = 10; # how many seconds to wait +my $wait_for = 120; # how many seconds to wait + +# don't lock anything - this is a tempfile anyway +$ENV{DBICTEST_LOCK_HOLDER} = -1; for my $close (0,1) { my $tmp = File::Temp->new( UNLINK => 1, - TMPDIR => 1, - SUFFIX => '.sqlite', + DIR => 't/var', + SUFFIX => '.db', + TEMPLATE => 'DBIxClass-XXXXXX', EXLOCK => 0, # important for BSD and derivatives ); @@ -33,8 +42,9 @@ for my $close (0,1) { lives_ok (sub { my $schema = DBICTest::Schema->connect ("DBI:SQLite:$tmp_fn"); + $schema->storage->dbh_do(sub { $_[1]->do('PRAGMA synchronous = OFF') }); DBICTest->deploy_schema ($schema); - #DBICTest->populate_schema ($schema); + DBICTest->populate_schema ($schema); }); alarm 0;