]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/lei-watch.t
www: drop --subject from "git send-email" instructions
[public-inbox.git] / t / lei-watch.t
index 86fa66493920d47c575335a4ede49ce7196f183d..24d9f5c890dcbc6ee52fc5b1d726396b7f765bcd 100644 (file)
@@ -3,6 +3,7 @@
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict; use v5.10.1; use PublicInbox::TestCommon;
 use File::Path qw(make_path remove_tree);
+plan skip_all => "TEST_FLAKY not enabled for $0" if !$ENV{TEST_FLAKY};
 require_mods('lei');
 my $have_fast_inotify = eval { require Linux::Inotify2 } ||
        eval { require IO::KQueue };
@@ -25,7 +26,7 @@ test_lei(sub {
                lei_ok 'daemon-pid'; chomp(my $pid = $lei_out);
                skip 'missing /proc/$PID/fd', 1 if !-d "/proc/$pid/fd";
                my @ino = grep {
-                       readlink($_) =~ /\binotify\b/
+                       (readlink($_) // '') =~ /\binotify\b/
                } glob("/proc/$pid/fd/*");
                is(scalar(@ino), 1, 'only one inotify FD');
                my $ino_fd = (split('/', $ino[0]))[-1];
@@ -52,13 +53,13 @@ test_lei(sub {
        my @f = glob("$md/cur/*:2,");
        is(scalar(@f), 1, 'got populated maildir with one result');
        rename($f[0], "$f[0]S") or xbail "rename $!"; # set (S)een
-       tick($have_fast_inotify ? 0.1 : 2.1); # always needed for 1 CPU systems
+       tick($have_fast_inotify ? 0.2 : 2.2); # always needed for 1 CPU systems
        lei_ok qw(note-event done); # flushes immediately (instead of 5s)
 
        lei_ok qw(q mid:testmessage@example.com -o), $md2, '-I', "$ro_home/t1";
        my @f2 = glob("$md2/*/*");
        is(scalar(@f2), 1, 'got one result');
-       like($f2[0], qr/S\z/, 'seen set from rename');
+       like($f2[0], qr/S\z/, 'seen set from rename') or diag explain(\@f2);
        my $e2 = eml_load($f2[0]);
        my $e1 = eml_load("$f[0]S");
        is_deeply($e2, $e1, 'results match');
@@ -91,7 +92,7 @@ test_lei(sub {
                $ino_fdinfo or skip 'Linux/inotify-only removal removal', 1;
                open my $fh, '<', $ino_fdinfo or xbail "open $ino_fdinfo: $!";
                my $cmp = [ <$fh> ];
-               is_deeply($cmp, $ino_contents, 'inotify Maildir watches gone');
+               is_xdeeply($cmp, $ino_contents, 'inotify Maildir watches gone');
        };
 });