[PATCH 3/9] test: add known broken tests for "ghost roots"

David Bremner david at tethera.net
Fri Jul 20 16:37:40 PDT 2018


This documents the bug discussed at

     id:87efgmmysi.fsf at 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 at example.org | grep ^Subject: | head -1  > OUTPUT
+cat <<EOF > 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 <<EOF > 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: <nonexistent-message at example.org>
 References: <000-real-root at example.org> <001-child at example.org> <nonexistent-message at 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



More information about the notmuch mailing list