[PATCH 1/3] test: test for race when tagging from emacs search
authorMark Walters <markwalters1009@gmail.com>
Fri, 9 Nov 2012 18:58:09 +0000 (18:58 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:28 +0000 (09:50 -0800)
a6/818cea850f5f6ddefb4f79af472b9c01421b51 [new file with mode: 0644]

diff --git a/a6/818cea850f5f6ddefb4f79af472b9c01421b51 b/a6/818cea850f5f6ddefb4f79af472b9c01421b51
new file mode 100644 (file)
index 0000000..b5f743e
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 44B9E431FBC\r
+       for <notmuch@notmuchmail.org>; Fri,  9 Nov 2012 10:58:27 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 4IoFNitdmirq for <notmuch@notmuchmail.org>;\r
+       Fri,  9 Nov 2012 10:58:26 -0800 (PST)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 8B84F431FB6\r
+       for <notmuch@notmuchmail.org>; Fri,  9 Nov 2012 10:58:26 -0800 (PST)\r
+Received: by mail-we0-f181.google.com with SMTP id u54so2100442wey.26\r
+       for <notmuch@notmuchmail.org>; Fri, 09 Nov 2012 10:58:25 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=Y5H9XJ7UkDa1lwFYiM9pdNkO6WG9JSzMJ8jOX4fhF7Y=;\r
+       b=jkvBdzmgvSiyImbrRDNPq6fkB2/Rj3lawHet1GQ65jALC+fkAGVagf9r64MDl3cFAL\r
+       IQFoHl1fBW0t/3WksgRLeRYrzm5sdAU05lrXM0HW4tbBGUsz4V98/VOpCswjsFqRW5J7\r
+       xt+nb8YfTlrtVjkFfzlwnRfESGfw8xjFzqpIxGMCd08CCvjNWK1O0ZK7nLw7wgwz9fVO\r
+       DWO+W9gJubIJInRChhRFNiIfVk94mEXT8YBL6IM5DKGXnNUknybtggwDPFiSYB0yNTVG\r
+       8wmPjZ6XM73ZXaXmIZfl3/DANMg6aORulYonGdpu3sTpLzd0xD9EuANLVHrNfRU+1FLT\r
+       Py7g==\r
+Received: by 10.180.108.38 with SMTP id hh6mr4220118wib.0.1352487505193;\r
+       Fri, 09 Nov 2012 10:58:25 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id fg6sm3340102wib.3.2012.11.09.10.58.23\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 09 Nov 2012 10:58:24 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/3] test: test for race when tagging from emacs search\r
+Date: Fri,  9 Nov 2012 18:58:09 +0000\r
+Message-Id: <1352487491-31512-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1352487491-31512-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1352487491-31512-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 09 Nov 2012 18:58:27 -0000\r
+\r
+When tagging from search view in emacs there is a race condition: it\r
+tags all messages in the thread even ones which arrived after the\r
+search was made. This can cause dataloss (if, for example, a thread is\r
+archived it could archive messages the user has never seen).\r
+\r
+Mark this test known broken.\r
+---\r
+ test/emacs |   23 +++++++++++++++++++++++\r
+ 1 files changed, 23 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 44f641e..6246177 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -122,6 +122,29 @@ test_emacs "(notmuch-search \"$os_x_darwin_thread\")\r
+ output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+ 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)"\r
+ \r
++test_begin_subtest "Tag all matching messages from search view"\r
++test_subtest_known_broken\r
++notmuch tag +test-tag-race from:cworth\r
++test_emacs "(notmuch-search \"tag:test-tag-race\")\r
++          (notmuch-test-wait)"\r
++notmuch tag +test-tag-race "id:1258471718-6781-2-git-send-email-dottedmag@dottedmag.net"\r
++test_emacs "(execute-kbd-macro \"*+test-tag-race-2\")"\r
++output=$(notmuch count tag:test-tag-race-2)\r
++test_expect_equal "$output" "12"\r
++notmuch tag -test-tag-race '*'\r
++notmuch tag -test-tag-race-2 '*'\r
++\r
++test_begin_subtest "Change tags from search view: another message arriving after thread lookup"\r
++test_subtest_known_broken\r
++typsos_id="878we4qdqf.fsf@yoom.home.cworth.org"\r
++typsos_thread=$(notmuch search --output=threads id:$typsos_id)\r
++test_emacs "(notmuch-search \"$typsos_thread\")\r
++          (notmuch-test-wait)"\r
++add_message "[subject]=\"new-thread-message\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"new-thread-message\"" "[in-reply-to]=\"<$typsos_id>\""\r
++test_emacs "(execute-kbd-macro \"+tag-from-search-view -unread\")"\r
++output=$(notmuch search tag:tag-from-search-view | notmuch_search_sanitize)\r
++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)"\r
++\r
+ test_begin_subtest "Add tag from notmuch-show view"\r
+ test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
+           (execute-kbd-macro \"+tag-from-show-view\")"\r
+-- \r
+1.7.9.1\r
+\r