From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A23DB1F5AE for ; Sun, 25 Jul 2021 11:15:06 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/lei-watch.t: improve test reliability Date: Sun, 25 Jul 2021 11:15:06 +0000 Message-Id: <20210725111506.20141-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lei-watch.t b/t/lei-watch.t index 9a3bfd80..86fa6649 100644 --- a/t/lei-watch.t +++ b/t/lei-watch.t @@ -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";