From fa04201baae9d1043e37cf8ef4e5a33fdd0498ff Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 1 Oct 2022 00:33:15 +0000 Subject: lei: force --jobs=1,1 for SQLite < 3.8.3 SQLite prior to 3.8.3 did not reset its PRNG for generating unique temporary file names, so it would barf on t/lei-up.t occasionally due to O_EXCL -> EEXIST conflicts. This fixes occasional test failures under CentOS 7.x which ships SQLite 3.7.17. --- lib/PublicInbox/OverIdx.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/PublicInbox/OverIdx.pm') diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index e7c96e14..a49ca6db 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -670,4 +670,16 @@ sub vivify_xvmd { $smsg->{-vivify_xvmd} = \@vivify_xvmd; } +sub fork_ok { + return 1 if $DBD::SQLite::sqlite_version >= 3008003; + my ($opt) = @_; + my @j = split(/,/, $opt->{jobs} // ''); + state $warned; + grep { $_ > 1 } @j and $warned //= warn('DBD::SQLite version is ', + $DBD::SQLite::sqlite_version, + ", need >= 3008003 (3.8.3) for --jobs > 1\n"); + $opt->{jobs} = '1,1'; + undef; +} + 1; -- cgit v1.2.3-24-ge0c7