database error
[notmuch-archives.git] / 41 / 38958677c415b24a39c177499336d57807202f
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 13C6E431FC9\r
6         for <notmuch@notmuchmail.org>; Mon, 23 Dec 2013 12:20:59 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id iWfHzFgfpA0Z for <notmuch@notmuchmail.org>;\r
16         Mon, 23 Dec 2013 12:20:51 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu\r
18         [18.9.25.14])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id E0EE1431FBF\r
22         for <notmuch@notmuchmail.org>; Mon, 23 Dec 2013 12:20:50 -0800 (PST)\r
23 X-AuditID: 1209190e-f79ee6d000000c40-77-52b89b20e496\r
24 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
25         (using TLS with cipher AES256-SHA (256/256 bits))\r
26         (Client did not present a certificate)\r
27         by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
28         id EE.0C.03136.02B98B25; Mon, 23 Dec 2013 15:20:48 -0500 (EST)\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
30         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id rBNKKj76018914; \r
31         Mon, 23 Dec 2013 15:20:45 -0500\r
32 Received: from drake.dyndns.org (a069.catapulsion.net [70.36.81.69])\r
33         (authenticated bits=0)\r
34         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
35         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id rBNKKgoG031693\r
36         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
37         Mon, 23 Dec 2013 15:20:44 -0500\r
38 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
39         (envelope-from <amdragon@mit.edu>)\r
40         id 1VvBzU-0004Hj-Rf; Mon, 23 Dec 2013 15:20:40 -0500\r
41 From: Austin Clements <amdragon@MIT.EDU>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH] test: Fix transient error in 'new' test\r
44 Date: Mon, 23 Dec 2013 15:20:36 -0500\r
45 Message-Id: <1387830036-16434-1-git-send-email-amdragon@mit.edu>\r
46 X-Mailer: git-send-email 1.8.4.rc3\r
47 In-Reply-To: <87bo089y0t.fsf@maritornes.cs.unb.ca>\r
48 References: <87bo089y0t.fsf@maritornes.cs.unb.ca>\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFjrJIsWRmVeSWpSXmKPExsUixCmqrKswe0eQwa+PvBY3WrsZLa7fnMns\r
51         wOTxbNUtZo8th94zBzBFcdmkpOZklqUW6dslcGVc2/SZsWClQMWT3beZGhjP8nYxcnJICJhI\r
52         XPi3hQXCFpO4cG89WxcjF4eQwGwmiZnvJjNCOBsZJbbc+scC4exikni9bCI7hDOXUaJ16gJW\r
53         kH42AQ2JbfuXM4LYIgLSEjvvzgaLMwtYSlz92s4EYgsLWEjcnr8QbB+LgKrEgqcggzg4eAUc\r
54         JFbMkoQ4Q0li4altYK2cAkYSZzbOBLOFBAwlHp44yTyBkX8BI8MqRtmU3Crd3MTMnOLUZN3i\r
55         5MS8vNQiXWO93MwSvdSU0k2M4FCS5NvB+PWg0iFGAQ5GJR7egtIdQUKsiWXFlbmHGCU5mJRE\r
56         ectnAoX4kvJTKjMSizPii0pzUosPMUpwMCuJ8N7NBMrxpiRWVqUW5cOkpDlYlMR5b3LYBwkJ\r
57         pCeWpGanphakFsFkZTg4lCR4S2YBNQoWpaanVqRl5pQgpJk4OEGG8wANXwNSw1tckJhbnJkO\r
58         kT/FqMvR9+/TN0Yhlrz8vFQpcV4bkCIBkKKM0jy4ObAU8IpRHOgtYd42kCoeYPqAm/QKaAkT\r
59         0JKmGdtAlpQkIqSkGhibPr5MW/2mkelv3J1pC7yWtb5+cfPpf5fdyzjEFt6WYGWUWablsN8s\r
60         gkf79M71p5iOBoXLN7qraf1rc8xYaGEaXJ+8ztnSU6qgK/jH/Bau3Ac3d6Upv4ld9+CZ7b2l\r
61         19W9c+Mev8pc9MHKZZbgkidNc4MDVIzztC794FynMH9WAe8OmVXnNX8psRRnJBpqMRcVJwIA\r
62         hgcZU9wCAAA=\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Mon, 23 Dec 2013 20:20:59 -0000\r
76 \r
77 This fixes a non-deterministic failure in "Ignore files and\r
78 directories specified in new.ignore (multiple occurrences)".  The test\r
79 assumed that all directories would be scanned, even though nothing\r
80 updated the mtime of ${MAIL_DIR}.  It *usually* worked nevertheless\r
81 because the tests run quickly enough that the directory mtime is\r
82 usually the same as the current time, so notmuch new does not update\r
83 the mtime in the database (because more changes could occur in the\r
84 same second).  However, when it occasionally did update the mtime in\r
85 the database, the notmuch new call in this test would (correctly) skip\r
86 "pass 2" of scanning ${MAIL_DIR}, causing it to skip the following\r
87 expected lines:\r
88 \r
89   (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.git\r
90   (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file\r
91   (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file\r
92 \r
93 This patch fixes this problem by touching ${MAIL_DIR} to ensure it\r
94 gets scanned and by rearranging the test to ensure the directories are\r
95 touched immediately before the main notmuch new call in the test.\r
96 ---\r
97  test/new | 3 ++-\r
98  1 file changed, 2 insertions(+), 1 deletion(-)\r
99 \r
100 diff --git a/test/new b/test/new\r
101 index 3eff2fe..f27423d 100755\r
102 --- a/test/new\r
103 +++ b/test/new\r
104 @@ -218,9 +218,10 @@ test_expect_equal "$output" "Added 1 new message to the database."\r
105  \r
106  test_begin_subtest "Ignore files and directories specified in new.ignore (multiple occurrences)"\r
107  notmuch config set new.ignore .git ignored_file .ignored_hidden_file\r
108 +notmuch new > /dev/null # ensure that files/folders will be printed in ASCII order.\r
109  touch "${MAIL_DIR}"/.git # change .git's mtime for notmuch new to rescan.\r
110 +touch "${MAIL_DIR}"      # likewise for MAIL_DIR\r
111  mkdir -p "${MAIL_DIR}"/one/two/three/.git\r
112 -notmuch new > /dev/null # ensure that files/folders will be printed in ASCII order.\r
113  touch "${MAIL_DIR}"/{one,one/two,one/two/three}/ignored_file\r
114  output=$(NOTMUCH_NEW --debug 2>&1 | sort)\r
115  test_expect_equal "$output" \\r
116 -- \r
117 1.8.4.rc3\r
118 \r