From: markwalters1009 Date: Sat, 24 Nov 2012 13:20:54 +0000 (+0000) Subject: [PATCH v2 5/7] test: test for race when tagging from emacs search X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=08b933f992236203c5fe3596bbfc227603f1d9fe;p=notmuch-archives.git [PATCH v2 5/7] test: test for race when tagging from emacs search --- diff --git a/95/3f7f113c9ff7890085d5ce7759d5ddb970b1ad b/95/3f7f113c9ff7890085d5ce7759d5ddb970b1ad new file mode 100644 index 000000000..ee6b0e7b6 --- /dev/null +++ b/95/3f7f113c9ff7890085d5ce7759d5ddb970b1ad @@ -0,0 +1,111 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 3E568431FBF + for ; Sat, 24 Nov 2012 05:21:17 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 8JGCiFCqG6Uu for ; + Sat, 24 Nov 2012 05:21:16 -0800 (PST) +Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com + [74.125.82.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 3F765431FBD for ; Sat, 24 Nov 2012 05:21:14 -0800 + (PST) +Received: by mail-wg0-f41.google.com with SMTP id ds1so1423804wgb.2 + for ; Sat, 24 Nov 2012 05:21:13 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=DmByQYtBM/JPv38+UjDIlnFxQuxknzHgZK3zJg8dlhg=; + b=cbQP8cbLAst2wQh8ZoMH3fFHSGmBr6lJggyFZrNEhKXb5r3NEbNHABupe7/KMXQ+nA + /4cCXxqaMatGTPYLmz22w9gIFd68MoTl1dk0Azv4ScBGimtxo0OVnumqyZQOIwkXt7cg + KqQuG1MFmwU9JJAyAGV49AFxk9G7IPNjeXNpWXk1IuNTfDvvYAcPyU1pKG+XRG1+x2Hd + vchYBs3bwBMPuBbxjyFWi0BDHCQMPnxRr+fWIILGG6oocHSIaVDH7/GByXnohjjiZhJt + Qj9AfA/e9D1ejotyE20sBZjv83BdTeAHXnWn6NFe67jU5wFnczNGRDVsQqbS2L95bEIb + 7iNA== +Received: by 10.180.92.103 with SMTP id cl7mr10225246wib.16.1353763272995; + Sat, 24 Nov 2012 05:21:12 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPS id b1sm14246026wix.11.2012.11.24.05.21.11 + (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 24 Nov 2012 05:21:12 -0800 (PST) +From: markwalters1009 +To: notmuch@notmuchmail.org +Subject: [PATCH v2 5/7] test: test for race when tagging from emacs search +Date: Sat, 24 Nov 2012 13:20:54 +0000 +Message-Id: <1353763256-32336-6-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1353763256-32336-1-git-send-email-markwalters1009@gmail.com> +References: <1353763256-32336-1-git-send-email-markwalters1009@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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, 24 Nov 2012 13:21:17 -0000 + +From: Mark Walters + +When tagging from search view in emacs there is a race condition: it +tags all messages in the thread even ones which arrived after the +search was made. This can cause dataloss (if, for example, a thread is +archived it could archive messages the user has never seen). + +Mark this test known broken. +--- + test/emacs | 23 +++++++++++++++++++++++ + 1 files changed, 23 insertions(+), 0 deletions(-) + +diff --git a/test/emacs b/test/emacs +index 77265b0..3788439 100755 +--- a/test/emacs ++++ b/test/emacs +@@ -122,6 +122,29 @@ test_emacs "(notmuch-search \"$os_x_darwin_thread\") + output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) + test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" + ++test_begin_subtest "Tag all matching messages from search view" ++test_subtest_known_broken ++notmuch tag +test-tag-race from:cworth ++test_emacs "(notmuch-search \"tag:test-tag-race\") ++ (notmuch-test-wait)" ++notmuch tag +test-tag-race "id:1258471718-6781-2-git-send-email-dottedmag@dottedmag.net" ++test_emacs "(execute-kbd-macro \"*+test-tag-race-2\")" ++output=$(notmuch count tag:test-tag-race-2) ++test_expect_equal "$output" "12" ++notmuch tag -test-tag-race '*' ++notmuch tag -test-tag-race-2 '*' ++ ++test_begin_subtest "Change tags from search view: another message arriving after thread lookup" ++test_subtest_known_broken ++typsos_id="878we4qdqf.fsf@yoom.home.cworth.org" ++typsos_thread=$(notmuch search --output=threads id:$typsos_id) ++test_emacs "(notmuch-search \"$typsos_thread\") ++ (notmuch-test-wait)" ++add_message "[subject]=\"new-thread-message\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"new-thread-message\"" "[in-reply-to]=\"<$typsos_id>\"" ++test_emacs "(execute-kbd-macro \"+tag-from-search-view -unread\")" ++output=$(notmuch search tag:tag-from-search-view | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2009-11-18 [2/3] Ingmar Vanhassel, Carl Worth| Notmuch Test Suite; [notmuch] [PATCH] Typsos (inbox tag-from-search-view unread)" ++ + test_begin_subtest "Add tag from notmuch-show view" + test_emacs "(notmuch-show \"$os_x_darwin_thread\") + (execute-kbd-macro \"+tag-from-show-view\")" +-- +1.7.9.1 +