Todoify test for now (2)
[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
12plan tests => 2;
13my $wait_for = 10; # how many seconds to wait
14
18b527f8 15# Fails on mac os *only*. Do not enable
48d2c1ea 16$TODO = "This seems to be a DBD::SQLite problem, don't test for now";
17
d7b94f7a 18for my $close (0,1) {
19
20 my $tmp = File::Temp->new( UNLINK => 1, TMPDIR => 1, SUFFIX => '.sqlite' );
21 my $tmp_fn = $tmp->filename;
22 close $tmp if $close;
23
24 local $SIG{ALRM} = sub { die sprintf (
25 "Timeout of %d seconds reached (tempfile still open: %s)",
26 $wait_for, $close ? 'No' : 'Yes'
27 )};
28
29 alarm $wait_for;
30
31 lives_ok (sub {
32 my $schema = DBICTest::Schema->connect ("DBI:SQLite:$tmp_fn");
d7b94f7a 33 DBICTest->deploy_schema ($schema);
34 DBICTest->populate_schema ($schema);
35 });
36
37 alarm 0;
38}