Todoify test for now
[dbsrgits/DBIx-Class.git] / t / zzzzzzz_sqlite_deadlock.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6 use lib 't/lib';
7
8 use File::Temp ();
9 use DBICTest;
10 use DBICTest::Schema;
11
12 plan tests => 2;
13 my $wait_for = 10;  # how many seconds to wait
14
15 $TODO = "This seems to be a DBD::SQLite problem, don't test for now";
16
17 for 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");
32     DBICTest->deploy_schema ($schema);
33     DBICTest->populate_schema ($schema);
34   });
35
36   alarm 0;
37 }