Todoify test for now (3)
[dbsrgits/DBIx-Class.git] / t / zzzzzzz_sqlite_deadlock.t
CommitLineData
d7b94f7a 1use strict;
2use warnings;
3
4use Test::More;
5use Test::Exception;
6use lib 't/lib';
7
8use File::Temp ();
9use DBICTest;
10use DBICTest::Schema;
11
6914a192 12plan skip_all => 'Fails on mac os *only*. Devs notified. Do not enable.';
13
d7b94f7a 14plan tests => 2;
15my $wait_for = 10; # how many seconds to wait
16
17for my $close (0,1) {
18
19 my $tmp = File::Temp->new( UNLINK => 1, TMPDIR => 1, SUFFIX => '.sqlite' );
20 my $tmp_fn = $tmp->filename;
21 close $tmp if $close;
22
23 local $SIG{ALRM} = sub { die sprintf (
24 "Timeout of %d seconds reached (tempfile still open: %s)",
25 $wait_for, $close ? 'No' : 'Yes'
26 )};
27
28 alarm $wait_for;
29
30 lives_ok (sub {
31 my $schema = DBICTest::Schema->connect ("DBI:SQLite:$tmp_fn");
d7b94f7a 32 DBICTest->deploy_schema ($schema);
33 DBICTest->populate_schema ($schema);
34 });
35
36 alarm 0;
37}