2 # Copyright (C) 2021 all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
7 use PublicInbox::TestCommon;
9 require_mods(qw(Search::Xapian DBD::SQLite));
10 require_ok 'PublicInbox::LeiOverview';
12 my $ovv = bless {}, 'PublicInbox::LeiOverview';
13 $ovv->ovv_out_lk_init;
14 my $lock_path = $ovv->{lock_path};
15 ok(-f $lock_path, 'lock init');
17 ok(!-f $lock_path, 'lock DESTROY');
19 $ovv = bless {}, 'PublicInbox::LeiOverview';
20 $ovv->ovv_out_lk_init;
21 $lock_path = $ovv->{lock_path};
22 ok(-f $lock_path, 'lock init #2');
23 my $pid = fork // BAIL_OUT "fork $!";
28 is(waitpid($pid, 0), $pid, 'child exited');
29 is($?, 0, 'no error in child process');
30 ok(-f $lock_path, 'lock was not destroyed by child');
32 ok(!-f $lock_path, 'lock DESTROY #2');