From: Mark Walters Date: Fri, 9 Nov 2012 18:58:09 +0000 (+0000) Subject: [PATCH 1/3] test: test for race when tagging from emacs search X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=e1c703901cf5010c71414c534e7f3065f07229d3;p=notmuch-archives.git [PATCH 1/3] test: test for race when tagging from emacs search --- diff --git a/a6/818cea850f5f6ddefb4f79af472b9c01421b51 b/a6/818cea850f5f6ddefb4f79af472b9c01421b51 new file mode 100644 index 000000000..b5f743e5c --- /dev/null +++ b/a6/818cea850f5f6ddefb4f79af472b9c01421b51 @@ -0,0 +1,109 @@ +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 44B9E431FBC + for ; Fri, 9 Nov 2012 10:58:27 -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 4IoFNitdmirq for ; + Fri, 9 Nov 2012 10:58:26 -0800 (PST) +Received: from mail-we0-f181.google.com (mail-we0-f181.google.com + [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8B84F431FB6 + for ; Fri, 9 Nov 2012 10:58:26 -0800 (PST) +Received: by mail-we0-f181.google.com with SMTP id u54so2100442wey.26 + for ; Fri, 09 Nov 2012 10:58:25 -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=Y5H9XJ7UkDa1lwFYiM9pdNkO6WG9JSzMJ8jOX4fhF7Y=; + b=jkvBdzmgvSiyImbrRDNPq6fkB2/Rj3lawHet1GQ65jALC+fkAGVagf9r64MDl3cFAL + IQFoHl1fBW0t/3WksgRLeRYrzm5sdAU05lrXM0HW4tbBGUsz4V98/VOpCswjsFqRW5J7 + xt+nb8YfTlrtVjkFfzlwnRfESGfw8xjFzqpIxGMCd08CCvjNWK1O0ZK7nLw7wgwz9fVO + DWO+W9gJubIJInRChhRFNiIfVk94mEXT8YBL6IM5DKGXnNUknybtggwDPFiSYB0yNTVG + 8wmPjZ6XM73ZXaXmIZfl3/DANMg6aORulYonGdpu3sTpLzd0xD9EuANLVHrNfRU+1FLT + Py7g== +Received: by 10.180.108.38 with SMTP id hh6mr4220118wib.0.1352487505193; + Fri, 09 Nov 2012 10:58:25 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPS id fg6sm3340102wib.3.2012.11.09.10.58.23 + (version=TLSv1/SSLv3 cipher=OTHER); + Fri, 09 Nov 2012 10:58:24 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 1/3] test: test for race when tagging from emacs search +Date: Fri, 9 Nov 2012 18:58:09 +0000 +Message-Id: <1352487491-31512-2-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1352487491-31512-1-git-send-email-markwalters1009@gmail.com> +References: <1352487491-31512-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: Fri, 09 Nov 2012 18:58:27 -0000 + +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 44f641e..6246177 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 +