From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 79DAA1F5CB for ; Thu, 26 Sep 2024 10:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1727348195; bh=noSuM9KoknR50JJ6BDYNL9NGN8ezPkdnO0vLKqUtugE=; h=From:To:Subject:Date:From; b=RxnIDKBOo4O6CkSM6kxDroiA2ji13qLNZNrquRBNfvcbCwtfNrcYwKAdjRwQp55Hp o0g9oYTqRyX1rIlKUE9cHnWDsuLetCmiE+U5pj9uvj5NqgteeM8mX/c1NRMPBLri5Q mDDVYwmFbKobsm9OkBdrASkXn9pJodsy9HCPIfJw= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/lei-import-imap: bail on missing UIDVALIDITY after import Date: Thu, 26 Sep 2024 10:56:35 +0000 Message-ID: <20240926105635.333349-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I haven't been able to reproduce it, but I've seen the test fail because ls-mail-sync didn't emit anything which matched /;UIDVALIDITY=(\d+)\s*/. Add some diagnostics and bail out right away if it happens again. --- t/lei-import-imap.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/lei-import-imap.t b/t/lei-import-imap.t index 3b6cb299..a835e82f 100644 --- a/t/lei-import-imap.t +++ b/t/lei-import-imap.t @@ -39,9 +39,10 @@ test_lei({ tmpdir => $tmpdir }, sub { lei_ok 'ls-mail-sync'; like($lei_out, qr!$re\n\z!, 'ls-mail-sync'); chomp(my $u = $lei_out); - lei_ok('import', $u, \'UIDVALIDITY match in URL'); $url = $u; - $u =~ s/;UIDVALIDITY=(\d+)\s*/;UIDVALIDITY=9$1/s; + $u =~ s/;UIDVALIDITY=(\d+)\s*/;UIDVALIDITY=9$1/s or + xbail 'no UIDVALIDITY=\\d+ in URL=', \$u, 'lei_out=', \$lei_out; + lei_ok('import', $url, \'UIDVALIDITY match in URL'); ok(!lei('import', $u), 'UIDVALIDITY mismatch in URL rejected'); like($lei_err, qr/UIDVALIDITY mismatch/, 'mismatch noted');