lei/store: stop shard workers + cat-file on idle
[public-inbox.git] / t / pop3d_lock.t
blobfb305f9682af1ab94c9dbb836d1b22eb489031e7
1 # Copyright (C) all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 use v5.12;
4 use PublicInbox::TestCommon;
5 require_mods(qw(DBD::SQLite Net::POP3 :fcntl_lock));
6 use autodie;
7 my $tmpdir = tmpdir;
8 require_ok 'PublicInbox::POP3D';
9 my $pop3d = bless {}, 'PublicInbox::POP3D';
10 open $pop3d->{txn_fh}, '+>>', "$tmpdir/txn.lock";
11 use Fcntl qw(F_SETLK F_UNLCK F_WRLCK);
13 ok $pop3d->_setlk(l_type => F_WRLCK, l_start => 9, l_len => 1),
14         'locked file (check with ktrace/strace)';
16 done_testing;