[PATCH] test: new: Fix intermittent test failures with --debug
authorEthan Glasser-Camp <ethan.glasser.camp@gmail.com>
Sun, 21 Oct 2012 13:14:58 +0000 (09:14 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:56 +0000 (09:49 -0800)
e0/f841c81dd47b10191ff7d340449c0127d37fd4 [new file with mode: 0644]

diff --git a/e0/f841c81dd47b10191ff7d340449c0127d37fd4 b/e0/f841c81dd47b10191ff7d340449c0127d37fd4
new file mode 100644 (file)
index 0000000..5a39b44
--- /dev/null
@@ -0,0 +1,104 @@
+Return-Path: <ethan.glasser.camp@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 C26A1431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 06:15:07 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 rEwLHeNE2ZTX for <notmuch@notmuchmail.org>;\r
+       Sun, 21 Oct 2012 06:15:07 -0700 (PDT)\r
+Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com\r
+       [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 46479431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 06:15:07 -0700 (PDT)\r
+Received: by mail-vb0-f53.google.com with SMTP id fc21so2164188vbb.26\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 06:15:06 -0700 (PDT)\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;\r
+       bh=p+z35O3MX1UXm8TishLzhPQe4eUii129TMV9QOi0k9g=;\r
+       b=gmGAhIP/mOpnjbN13EG7/w8n3YfOJQRUmaiaPZts5LxMM6WMhzRJ0GpXhqd7y99DPE\r
+       P/VXkCsyBV9fWNeecluASrcuC4HIXLRea1bUajD8Yw8OL95K2XMpMjPl9UOQuA2LoqBQ\r
+       3/7g8OZA4qZ0EAqoBKGm0tW+IF3p8SAx/XlN81Ie+WMVyYYdepUvFt68opSPWrGUhmPA\r
+       M2MN93pU+1YaqjP+6cbLQTXd+0LJ8LQ1OPSeXt6EKBv6b6d0lnR1aMPSbkIufFSbHRsG\r
+       GOhS5BYhVjKheyjWbml3Z6flCxSrcwNIyKhrcuWSj/NFQ0IxX8wzLR/+v4EnUzNXg1dy\r
+       i/1A==\r
+Received: by 10.58.73.137 with SMTP id l9mr10731510vev.44.1350825306689;\r
+       Sun, 21 Oct 2012 06:15:06 -0700 (PDT)\r
+Received: from smtp.gmail.com (p70-80.acedsl.com. [66.114.70.80])\r
+       by mx.google.com with ESMTPS id b8sm6843978veq.1.2012.10.21.06.15.05\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 21 Oct 2012 06:15:05 -0700 (PDT)\r
+From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test: new: Fix intermittent test failures with --debug\r
+Date: Sun, 21 Oct 2012 09:14:58 -0400\r
+Message-Id: <1350825298-8261-1-git-send-email-ethan@betacantrips.com>\r
+X-Mailer: git-send-email 1.7.9.5\r
+Cc: Ethan Glasser-Camp <ethan@betacantrips.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: Sun, 21 Oct 2012 13:15:07 -0000\r
+\r
+Although messages are created in a particular order, it seems that\r
+when they are created on a tmpfs, they do not always come back in the\r
+same order, leading to the same files being ignored but being output\r
+in a different order. This causes the test to fail because the outputs\r
+being compared are the same.\r
+\r
+Fix the failures by sorting the output of notmuch --debug and\r
+comparing this to a hand-sorted version of its output.\r
+\r
+Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>\r
+---\r
+ test/new |   10 +++++-----\r
+ 1 file changed, 5 insertions(+), 5 deletions(-)\r
+\r
+diff --git a/test/new b/test/new\r
+index cc2af72..587aa11 100755\r
+--- a/test/new\r
++++ b/test/new\r
+@@ -189,17 +189,17 @@ touch "${MAIL_DIR}"/.git # change .git's mtime for notmuch new to rescan.\r
+ mkdir -p "${MAIL_DIR}"/one/two/three/.git\r
+ notmuch new > /dev/null # ensure that files/folders will be printed in ASCII order.\r
+ touch "${MAIL_DIR}"/{one,one/two,one/two/three}/ignored_file\r
+-output=$(NOTMUCH_NEW --debug 2>&1)\r
++output=$(NOTMUCH_NEW --debug 2>&1 | sort)\r
+ test_expect_equal "$output" \\r
+ "(D) add_files_recursive, pass 1: explicitly ignoring ${MAIL_DIR}/.git\r
+ (D) add_files_recursive, pass 1: explicitly ignoring ${MAIL_DIR}/one/two/three/.git\r
+-(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/.git\r
+-(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file\r
+-(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file\r
+-(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/ignored_file\r
+ (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.git\r
+ (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file\r
+ (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/ignored_file\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/.git\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file\r
+ No new mail."\r
+ \r
+ \r
+-- \r
+1.7.9.5\r
+\r