]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/lei-watch.t: improve test reliability
authorEric Wong <e@80x24.org>
Sun, 25 Jul 2021 11:15:06 +0000 (11:15 +0000)
committerEric Wong <e@80x24.org>
Sun, 25 Jul 2021 11:15:28 +0000 (11:15 +0000)
On single CPU (and overloaded SMP) systems, we can't rely on
inotify in lei-daemon firing before a "lei note-event done"
client hits it.  So force in a single tick() to ensure the
scheduler can yield to lei-daemon and see the inotify wakeup
before "lei note-event done" to commit the write.

t/lei-watch.t

index 9a3bfd80551eb7decd376b3e998cfdb891f4e83e..86fa66493920d47c575335a4ede49ce7196f183d 100644 (file)
@@ -52,7 +52,7 @@ 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
-       $have_fast_inotify or tick(2);
+       tick($have_fast_inotify ? 0.1 : 2.1); # 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";