From cc72e75befd63a9b4ae91fdfe3375380f59ed95c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 24 Dec 2013 15:20:36 +1900 Subject: [PATCH] [PATCH] test: Fix transient error in 'new' test --- 41/38958677c415b24a39c177499336d57807202f | 118 ++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 41/38958677c415b24a39c177499336d57807202f diff --git a/41/38958677c415b24a39c177499336d57807202f b/41/38958677c415b24a39c177499336d57807202f new file mode 100644 index 000000000..7c7ba85e0 --- /dev/null +++ b/41/38958677c415b24a39c177499336d57807202f @@ -0,0 +1,118 @@ +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 13C6E431FC9 + for ; Mon, 23 Dec 2013 12:20:59 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 iWfHzFgfpA0Z for ; + Mon, 23 Dec 2013 12:20:51 -0800 (PST) +Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu + [18.9.25.14]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id E0EE1431FBF + for ; Mon, 23 Dec 2013 12:20:50 -0800 (PST) +X-AuditID: 1209190e-f79ee6d000000c40-77-52b89b20e496 +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id EE.0C.03136.02B98B25; Mon, 23 Dec 2013 15:20:48 -0500 (EST) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id rBNKKj76018914; + Mon, 23 Dec 2013 15:20:45 -0500 +Received: from drake.dyndns.org (a069.catapulsion.net [70.36.81.69]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rBNKKgoG031693 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Mon, 23 Dec 2013 15:20:44 -0500 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1VvBzU-0004Hj-Rf; Mon, 23 Dec 2013 15:20:40 -0500 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH] test: Fix transient error in 'new' test +Date: Mon, 23 Dec 2013 15:20:36 -0500 +Message-Id: <1387830036-16434-1-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.8.4.rc3 +In-Reply-To: <87bo089y0t.fsf@maritornes.cs.unb.ca> +References: <87bo089y0t.fsf@maritornes.cs.unb.ca> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFjrJIsWRmVeSWpSXmKPExsUixCmqrKswe0eQwa+PvBY3WrsZLa7fnMns + wOTxbNUtZo8th94zBzBFcdmkpOZklqUW6dslcGVc2/SZsWClQMWT3beZGhjP8nYxcnJICJhI + XPi3hQXCFpO4cG89WxcjF4eQwGwmiZnvJjNCOBsZJbbc+scC4exikni9bCI7hDOXUaJ16gJW + kH42AQ2JbfuXM4LYIgLSEjvvzgaLMwtYSlz92s4EYgsLWEjcnr8QbB+LgKrEgqcggzg4eAUc + JFbMkoQ4Q0li4altYK2cAkYSZzbOBLOFBAwlHp44yTyBkX8BI8MqRtmU3Crd3MTMnOLUZN3i + 5MS8vNQiXWO93MwSvdSU0k2M4FCS5NvB+PWg0iFGAQ5GJR7egtIdQUKsiWXFlbmHGCU5mJRE + ectnAoX4kvJTKjMSizPii0pzUosPMUpwMCuJ8N7NBMrxpiRWVqUW5cOkpDlYlMR5b3LYBwkJ + pCeWpGanphakFsFkZTg4lCR4S2YBNQoWpaanVqRl5pQgpJk4OEGG8wANXwNSw1tckJhbnJkO + kT/FqMvR9+/TN0Yhlrz8vFQpcV4bkCIBkKKM0jy4ObAU8IpRHOgtYd42kCoeYPqAm/QKaAkT + 0JKmGdtAlpQkIqSkGhibPr5MW/2mkelv3J1pC7yWtb5+cfPpf5fdyzjEFt6WYGWUWablsN8s + gkf79M71p5iOBoXLN7qraf1rc8xYaGEaXJ+8ztnSU6qgK/jH/Bau3Ac3d6Upv4ld9+CZ7b2l + 19W9c+Mev8pc9MHKZZbgkidNc4MDVIzztC794FynMH9WAe8OmVXnNX8psRRnJBpqMRcVJwIA + hgcZU9wCAAA= +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: Mon, 23 Dec 2013 20:20:59 -0000 + +This fixes a non-deterministic failure in "Ignore files and +directories specified in new.ignore (multiple occurrences)". The test +assumed that all directories would be scanned, even though nothing +updated the mtime of ${MAIL_DIR}. It *usually* worked nevertheless +because the tests run quickly enough that the directory mtime is +usually the same as the current time, so notmuch new does not update +the mtime in the database (because more changes could occur in the +same second). However, when it occasionally did update the mtime in +the database, the notmuch new call in this test would (correctly) skip +"pass 2" of scanning ${MAIL_DIR}, causing it to skip the following +expected lines: + + (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.git + (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file + (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file + +This patch fixes this problem by touching ${MAIL_DIR} to ensure it +gets scanned and by rearranging the test to ensure the directories are +touched immediately before the main notmuch new call in the test. +--- + test/new | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/test/new b/test/new +index 3eff2fe..f27423d 100755 +--- a/test/new ++++ b/test/new +@@ -218,9 +218,10 @@ test_expect_equal "$output" "Added 1 new message to the database." + + test_begin_subtest "Ignore files and directories specified in new.ignore (multiple occurrences)" + notmuch config set new.ignore .git ignored_file .ignored_hidden_file ++notmuch new > /dev/null # ensure that files/folders will be printed in ASCII order. + touch "${MAIL_DIR}"/.git # change .git's mtime for notmuch new to rescan. ++touch "${MAIL_DIR}" # likewise for MAIL_DIR + mkdir -p "${MAIL_DIR}"/one/two/three/.git +-notmuch new > /dev/null # ensure that files/folders will be printed in ASCII order. + touch "${MAIL_DIR}"/{one,one/two,one/two/three}/ignored_file + output=$(NOTMUCH_NEW --debug 2>&1 | sort) + test_expect_equal "$output" \ +-- +1.8.4.rc3 + -- 2.26.2