From 411cd59e8274f679110021701b3489149a8e7f47 Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Sat, 15 Aug 2009 09:34:12 +0000 Subject: [PATCH] DBD-SQLite: added a comment to the busy test, and made the first timeout happen sooner --- t/08_busy.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/08_busy.t b/t/08_busy.t index 8cbc8e9..7703d25 100644 --- a/t/08_busy.t +++ b/t/08_busy.t @@ -30,7 +30,14 @@ foreach my $call_func (@CALL_FUNCS) { AutoCommit => 0, ); - ok($dbh2->$call_func(3000, 'busy_timeout')); + # NOTE: Let's make it clear what we're doing here. + # $dbh starts locking with the first INSERT statement. + # $dbh2 tries to INSERT, but as the database is locked, + # it starts waiting. However, $dbh won't release the lock. + # Eventually $dbh2 gets timed out, and spits an error, saying + # the database is locked. So, we don't need to let $dbh2 wait + # too much here. It should be timed out anyway. + ok($dbh2->$call_func(300, 'busy_timeout')); ok($dbh->do("CREATE TABLE Blah ( id INTEGER, val VARCHAR )")); ok($dbh->commit);