Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id D46BA6DE02DD for ; Sat, 2 Apr 2016 07:15:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.732 X-Spam-Level: X-Spam-Status: No, score=-0.732 tagged_above=-999 required=5 tests=[AWL=-0.732] 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 z9Rk9reRS0wE for ; Sat, 2 Apr 2016 07:15:47 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108]) by arlo.cworth.org (Postfix) with ESMTP id B818C6DE02C2 for ; Sat, 2 Apr 2016 07:15:47 -0700 (PDT) Received: from fifthhorseman.net (dhcp-a244.meeting.ietf.org [31.133.162.68]) by che.mayfirst.org (Postfix) with ESMTPSA id 81238F99A for ; Sat, 2 Apr 2016 10:15:45 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id A4F441FD2C; Sat, 2 Apr 2016 11:15:41 -0300 (BRT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 2/7] verify during thread-breakage that messages are removed as well Date: Sat, 2 Apr 2016 11:15:36 -0300 Message-Id: <1459606541-23889-2-git-send-email-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1459606541-23889-1-git-send-email-dkg@fifthhorseman.net> References: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net> <1459606541-23889-1-git-send-email-dkg@fifthhorseman.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 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: Sat, 02 Apr 2016 14:15:55 -0000 One risk of fixes to the thread-breakage problem is that we could fail to remove the search term indexes entirely. These additional subtests should guard against that. --- test/T590-thread-breakage.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/T590-thread-breakage.sh b/test/T590-thread-breakage.sh index 704f504..f3e725c 100755 --- a/test/T590-thread-breakage.sh +++ b/test/T590-thread-breakage.sh @@ -17,6 +17,7 @@ To: Bob Date: Thu, 31 Mar 2016 20:10:00 -0400 This is the first message in the thread. +Apple EOF } @@ -32,10 +33,18 @@ To: Alice Date: Thu, 31 Mar 2016 20:15:00 -0400 This is the second message in the thread. +Banana EOF } +test_subject_count() { + notmuch new >/dev/null + test_begin_subtest "${3:-looking for $2 instance of '$1'}" + count=$(notmuch count --output=threads "$1") + test_expect_equal "$count" "$2" +} + test_thread_count() { notmuch new >/dev/null test_begin_subtest "${2:-Expecting $1 thread(s)}" @@ -47,17 +56,25 @@ test_thread_count 0 'There should be no threads initially' message_a test_thread_count 1 'One message in: one thread' +test_subject_count apple 1 +test_subject_count banana 0 message_b test_thread_count 1 'Second message in the same thread: one thread' +test_subject_count apple 1 +test_subject_count banana 1 rm -f ${MAIL_DIR}/cur/a test_thread_count 1 'First message removed: still only one thread' +test_subject_count apple 0 +test_subject_count banana 1 message_a # this is known to fail (it shows 2 threads) because no "ghost # message" was created for message A when it was removed from the # index, despite message B still pointing to it. test_thread_count 1 'First message reappears: should return to the same thread' +test_subject_count apple 1 +test_subject_count banana 1 test_done -- 2.8.0.rc3