lei/store: stop shard workers + cat-file on idle
[public-inbox.git] / t / inotify3.t
blobc25c0f4251443295f749d40663bcf37aa1fc33ea
1 #!perl -w
2 # Copyright (C) all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 use v5.12; use PublicInbox::TestCommon;
5 plan skip_all => 'inotify is Linux-only' if $^O ne 'linux';
6 use_ok 'PublicInbox::Inotify3';
7 my $in = PublicInbox::Inotify3->new;
8 my $tmpdir = tmpdir;
9 my $w = $in->watch("$tmpdir", PublicInbox::Inotify3::IN_ALL_EVENTS());
10 $in->blocking(0);
11 is_xdeeply [ $in->read ], [], 'non-blocking has no events, yet';
12 undef $tmpdir;
13 my @list = $in->read;
14 ok scalar(@list), 'got events';
15 ok $w->cancel, 'watch canceled';
17 done_testing;