From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B189B6DE0318 for ; Fri, 20 Jul 2018 16:38:39 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nju4bUdPkftz for ; Fri, 20 Jul 2018 16:38:39 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 866FE6DE0260 for ; Fri, 20 Jul 2018 16:38:38 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1fgeyq-00025v-Ia; Fri, 20 Jul 2018 19:38:36 -0400 Received: (nullmailer pid 2973 invoked by uid 1000); Fri, 20 Jul 2018 23:37:52 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 3/9] test: add known broken tests for "ghost roots" Date: Sat, 21 Jul 2018 08:37:40 +0900 Message-Id: <20180720233746.2844-4-david@tethera.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180720233746.2844-1-david@tethera.net> References: <20180720233746.2844-1-david@tethera.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2018 23:38:39 -0000 This documents the bug discussed at id:87efgmmysi.fsf@len.workgroup The underlying issue is that the reply to a ghost (missing) message is falsely classified as a root message in _resolve_thread_relationships. The first test is simpler / more robust, but also easier to fool. --- test/T260-thread-order.sh | 27 +++++++++++++++++++++ test/corpora/threading/ghost-root/fake-root | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/test/T260-thread-order.sh b/test/T260-thread-order.sh index fea61275..ce8636b9 100755 --- a/test/T260-thread-order.sh +++ b/test/T260-thread-order.sh @@ -75,4 +75,31 @@ $(for ((i = 0; i < $nthreads; i++)); do done test_expect_equal "$output" "$expected" +add_email_corpus threading + +test_begin_subtest "reply to ghost" +test_subtest_known_broken +notmuch show --entire-thread=true id:000-real-root@example.org | grep ^Subject: | head -1 > OUTPUT +cat < EXPECTED +Subject: root message +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "reply to ghost (tree view)" +test_subtest_known_broken +test_emacs '(notmuch-tree "tag:inbox") + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +cat < EXPECTED + 2016-06-17 Alice ┬►root message (inbox unread) + 2016-06-18 Alice ╰┬►child message (inbox unread) + 2016-06-18 Alice ├┬►grand-child message (inbox unread) + 2016-06-18 Alice │╰─►great grand-child message (inbox unread) + 2016-06-18 Daniel ├─►grand-child message 2 (inbox unread) + 2016-06-17 Mallory ╰─►fake root message (inbox unread) +End of search results. +EOF +test_expect_equal_file EXPECTED OUTPUT + test_done diff --git a/test/corpora/threading/ghost-root/fake-root b/test/corpora/threading/ghost-root/fake-root index 102bb228..5be228fd 100644 --- a/test/corpora/threading/ghost-root/fake-root +++ b/test/corpora/threading/ghost-root/fake-root @@ -6,4 +6,4 @@ In-Reply-to: References: <000-real-root@example.org> <001-child@example.org> Date: Thu, 16 Jun 2016 22:14:41 -0400 -This message has no reply-to +This message has a reply-to to a non-existent message -- 2.18.0