Subject: | DBD::SQLite::db do failed: database is locked |
On some *BSD systems, the test suite fails with a lock error:
...
DBD::SQLite::db do failed: database is locked at /home/cpansand/.cpan/build/2020011419/Test-SQLite-0.0207-Y6AVaR/blib/lib/Test/SQLite.pm line 86, <$schema> line 3.
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::SQLite::db handle dbname=/var/tmp/cpansmoker-1023/2020011419/jaRSDJeTOR.db at /home/cpansand/.cpan/build/2020011419/Test-SQLite-0.0207-Y6AVaR/blib/lib/Test/SQLite.pm line 86, <$schema> line 3.
DBD::SQLite::db do failed: database is locked at /home/cpansand/.cpan/build/2020011419/Test-SQLite-0.0207-Y6AVaR/blib/lib/Test/SQLite.pm line 86, <$schema> line 3.
# Child (from schema) exited without calling finalize()
# Failed test 'from schema'
# at /usr/perl5.20.1Dp/lib/site_perl/5.20.1/Test/Builder.pm line 279.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 35 just after 3.
t/01-methods.t ...........
Dubious, test returned 35 (wstat 8960, 0x2300)
Failed 1/3 subtests
...
It's very likely that this lock problem is caused by older File::Temp versions. The recent documentation says:
To open the temporary filehandle with O_EXLOCK (open with exclusive
file lock) use "EXLOCK=>1". This is supported only by some operating
systems (most notably BSD derived systems). By default EXLOCK will
be false. Former "File::Temp" versions set EXLOCK to true, so to be
sure to get an unlocked filehandle also with older versions,
explicitly set "EXLOCK=>0".
So if you're creating temporary files to be used for sqlite database, you have to either set explicitly EXLOCK to a false value, or alternatively increase the minimum File::Temp version on *BSD systems (probably MacOSX is also affected).