Subject: | Possible file locking issue in test suite |
On my FreeBSD smokers I see the following test failure:
...
# Write a hash in 003
DBD::SQLite::db do failed: database is locked at /home/cpansand/.cpan/build/2017081106/SQLite_File-0.1001-HzMbbO/blib/lib/SQLite_File.pm line 326.
DBD::SQLite::db do failed: database is locked at /home/cpansand/.cpan/build/2017081106/SQLite_File-0.1001-HzMbbO/blib/lib/SQLite_File.pm line 326.
t/003_barry.t .....
Dubious, test returned 35 (wstat 8960, 0x2300)
No subtests run
# Read the hash in 004
SQLite_File: Can't open db file: No such file or directory at t/004_barry.t line 17.
(in cleanup) Can't call method "commit" on an undefined value at /home/cpansand/.cpan/build/2017081106/SQLite_File-0.1001-HzMbbO/blib/lib/SQLite_File.pm line 802.
t/004_barry.t .....
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
t/005_rt122654.t .. ok
...
This does not happen on my linux smokers. The pattern looks familiar to me: a SQLite file locking issue, which only happens on freebsd systems (and probably also MacOSX, but I don't have a Mac right now for testing). Probably you create a temporary file using File::Temp, which does O_EXLOCK by default on *BSD systems. To fix this, you should pass EXLOCK=>0 when creating the temporary file. THis option is a no-op on linux systems, and prevents locking on *BSD systems.