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 A1CF06DE02A7 for ; Fri, 1 Apr 2016 18:50:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 pclIU35IZRz2 for ; Fri, 1 Apr 2016 18:50:13 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108]) by arlo.cworth.org (Postfix) with ESMTP id 9A1C36DE0243 for ; Fri, 1 Apr 2016 18:50:13 -0700 (PDT) Received: from fifthhorseman.net (unknown [190.172.4.74]) by che.mayfirst.org (Postfix) with ESMTPSA id 2E2A9F999 for ; Fri, 1 Apr 2016 21:50:09 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 802DE205D6; Fri, 1 Apr 2016 20:31:55 -0300 (BRT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH 1/2] verify during thread-breakage that messages are removed as well Date: Fri, 1 Apr 2016 20:31:54 -0300 Message-Id: <1459553515-18802-1-git-send-email-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net> References: <1459445693-3900-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 01:50:21 -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