Re: A systematic way of handling Xapian lock errors?
[notmuch-archives.git] / f2 / 20215b45d371092d1cd33fa4cc3634c7828f9f
1 Return-Path: <amdragon@gmail.com>\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 29AA8429E27\r
6         for <notmuch@notmuchmail.org>; Mon,  9 May 2011 22:47:20 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.699\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
13         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id G47S4kgzV9cb for <notmuch@notmuchmail.org>;\r
17         Mon,  9 May 2011 22:47:19 -0700 (PDT)\r
18 Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com\r
19         [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id D301B429E26\r
22         for <notmuch@notmuchmail.org>; Mon,  9 May 2011 22:47:18 -0700 (PDT)\r
23 Received: by qwb7 with SMTP id 7so4136803qwb.26\r
24         for <notmuch@notmuchmail.org>; Mon, 09 May 2011 22:47:18 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=domainkey-signature:mime-version:sender:in-reply-to:references:date\r
27         :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
28         :content-transfer-encoding;\r
29         bh=jIJ7If+HR7xaDjInsUZ4VGn7CII/JHwQrTVUwzEMg7s=;\r
30         b=pk4bt+fLeL6bSbquAqa2KqIza+QPOI1B4cA4cbXZB1ILOqUmZZ5wK7jM/VSKZOMBio\r
31         3PMpHJKVPld0peG3lDHHJYRQZcy4VoxCBIzJZw276vEjZ2l8XzVqDpons94p8feoYD6u\r
32         I17w4XzRvwn6EgIa1PCpMDD5F1iWhC6+1I5ps=\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
34         h=mime-version:sender:in-reply-to:references:date\r
35         :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
36         :content-transfer-encoding;\r
37         b=j4iCYNnEzUKSDT9qy2KVpLWRsWw8I09opxTiJKWNX0Sp9i3EK3TAAMp5XQZEwB+5Jf\r
38         gjOL4YFd8IHLtPqZkR1ZYckmbWJsTCWH2MGyaSSn2CLVijp4XF7yvUamMbAsoSYjz5Vr\r
39         z/m6l1KbRgxWb8W86ZPH/uPGf4tVozfOP24HQ=\r
40 MIME-Version: 1.0\r
41 Received: by 10.229.101.36 with SMTP id a36mr5752079qco.74.1305006437952; Mon,\r
42         09 May 2011 22:47:17 -0700 (PDT)\r
43 Sender: amdragon@gmail.com\r
44 Received: by 10.229.233.17 with HTTP; Mon, 9 May 2011 22:47:17 -0700 (PDT)\r
45 In-Reply-To: <1305006007-26445-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46 References: <1305006007-26445-1-git-send-email-dmitry.kurochkin@gmail.com>\r
47 Date: Tue, 10 May 2011 01:47:17 -0400\r
48 X-Google-Sender-Auth: s3MMDTE-j05QE4MGA4BQQlFLp1k\r
49 Message-ID: <BANLkTi=7nAq=Hx=AwaPe=wKrC_t95OETQw@mail.gmail.com>\r
50 Subject: Re: [PATCH] test: add "%s" format string to all `message' calls in\r
51         emacs tests\r
52 From: Austin Clements <amdragon@mit.edu>\r
53 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
54 Content-Type: text/plain; charset=ISO-8859-1\r
55 Content-Transfer-Encoding: quoted-printable\r
56 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Tue, 10 May 2011 05:47:20 -0000\r
70 \r
71 This looks good to me (and is certainly more correct), but seems\r
72 rather roundabout.  Is there a reason this code doesn't simply (princ\r
73 (buffer-string))?\r
74 \r
75 On Tue, May 10, 2011 at 1:40 AM, Dmitry Kurochkin\r
76 <dmitry.kurochkin@gmail.com> wrote:\r
77 > The patch replaces all (message (buffer-string)) calls in emacs\r
78 > tests with (message "%s" (buffer-string)). =A0This works around an\r
79 > Emacs (23.3+1-1 on current Debian Unstable) segfault in "Ensure\r
80 > that emacs doesn't drop results" test. =A0Note: the segfault does\r
81 > not happen on every test run. =A0Though, it seems to be\r
82 > consistently reproducible if the test uses 300 messages instead\r
83 > of 30. =A0Hopefully, it is the crash described in Emacs bug #8545\r
84 > [1] which is already fixed.\r
85 >\r
86 > Also, the patch makes the code more correct - we want to avoid\r
87 > accidentally interpreting '%' as format specifiers.\r
88 >\r
89 > [1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8545\r
90 > ---\r
91 >\r
92 > The patch applies to the release-candidate/0.6 branch.\r
93 >\r
94 > Regards,\r
95 > =A0Dmitry\r
96 >\r
97 >\r
98 > =A0test/emacs =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 18 +++++++++-=\r
99 --------\r
100 > =A0test/emacs-large-search-buffer | =A0 =A05 +++--\r
101 > =A02 files changed, 12 insertions(+), 11 deletions(-)\r
102 >\r
103 > diff --git a/test/emacs b/test/emacs\r
104 > index b376033..5b39423 100755\r
105 > --- a/test/emacs\r
106 > +++ b/test/emacs\r
107 > @@ -7,38 +7,38 @@ EXPECTED=3D../emacs.expected-output\r
108 > =A0add_email_corpus\r
109 >\r
110 > =A0test_begin_subtest "Basic notmuch-hello view in emacs"\r
111 > -output=3D$(test_emacs '(notmuch-hello) (message (buffer-string))' 2>&1)\r
112 > +output=3D$(test_emacs '(notmuch-hello) (message "%s" (buffer-string))' 2=\r
113 >&1)\r
114 > =A0expected=3D$(cat $EXPECTED/notmuch-hello)\r
115 > =A0test_expect_equal "$output" "$expected"\r
116 >\r
117 > =A0test_begin_subtest "Saved search with 0 results"\r
118 > -output=3D$(test_emacs '(setq notmuch-show-empty-saved-searches t) (setq =\r
119 notmuch-saved-searches '\''(("inbox" . "tag:inbox") ("unread" . "tag:unread=\r
120 ") ("empty" . "tag:doesnotexist"))) (notmuch-hello) (message (buffer-string=\r
121 ))' 2>&1)\r
122 > +output=3D$(test_emacs '(setq notmuch-show-empty-saved-searches t) (setq =\r
123 notmuch-saved-searches '\''(("inbox" . "tag:inbox") ("unread" . "tag:unread=\r
124 ") ("empty" . "tag:doesnotexist"))) (notmuch-hello) (message "%s" (buffer-s=\r
125 tring))' 2>&1)\r
126 > =A0expected=3D$(cat $EXPECTED/notmuch-hello-with-empty)\r
127 > =A0test_expect_equal "$output" "$expected"\r
128 >\r
129 > =A0test_begin_subtest "No saved searches displayed (all with 0 results)"\r
130 > -output=3D$(test_emacs '(setq notmuch-saved-searches '\''(("empty" . "tag=\r
131 :doesnotexist"))) (notmuch-hello) (message (buffer-string))' 2>&1)\r
132 > +output=3D$(test_emacs '(setq notmuch-saved-searches '\''(("empty" . "tag=\r
133 :doesnotexist"))) (notmuch-hello) (message "%s" (buffer-string))' 2>&1)\r
134 > =A0expected=3D$(cat $EXPECTED/notmuch-hello-no-saved-searches)\r
135 > =A0test_expect_equal "$output" "$expected"\r
136 >\r
137 > =A0test_begin_subtest "Basic notmuch-search view in emacs"\r
138 > -output=3D$(test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) =\r
139 (message (buffer-string))' 2>&1)\r
140 > +output=3D$(test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) =\r
141 (message "%s" (buffer-string))' 2>&1)\r
142 > =A0expected=3D$(cat $EXPECTED/notmuch-search-tag-inbox)\r
143 > =A0test_expect_equal "$output" "$expected"\r
144 >\r
145 > =A0test_begin_subtest "Navigation of notmuch-hello to search results"\r
146 > -output=3D$(test_emacs '(notmuch-hello) (goto-char (point-min)) (re-searc=\r
147 h-forward "inbox") (widget-button-press (point)) (notmuch-test-wait) (messa=\r
148 ge (buffer-string))' 2>&1)\r
149 > +output=3D$(test_emacs '(notmuch-hello) (goto-char (point-min)) (re-searc=\r
150 h-forward "inbox") (widget-button-press (point)) (notmuch-test-wait) (messa=\r
151 ge "%s" (buffer-string))' 2>&1)\r
152 > =A0expected=3D$(cat $EXPECTED/notmuch-hello-view-inbox)\r
153 > =A0test_expect_equal "$output" "$expected"\r
154 >\r
155 > =A0test_begin_subtest "Basic notmuch-show view in emacs"\r
156 > =A0maildir_storage_thread=3D$(notmuch search --output=3Dthreads id:200911=\r
157 17190054.GU3165@dottiness.seas.harvard.edu)\r
158 > -output=3D$(test_emacs "(notmuch-show \"$maildir_storage_thread\") (messa=\r
159 ge (buffer-string))" 2>&1)\r
160 > +output=3D$(test_emacs "(notmuch-show \"$maildir_storage_thread\") (messa=\r
161 ge \"%s\" (buffer-string))" 2>&1)\r
162 > =A0expected=3D$(cat $EXPECTED/notmuch-show-thread-maildir-storage)\r
163 > =A0test_expect_equal "$output" "$expected"\r
164 >\r
165 > =A0test_begin_subtest "Navigation of notmuch-search to thread view"\r
166 > -output=3D$(test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) =\r
167 (goto-char (point-min)) (re-search-forward "Working with Maildir") (notmuch=\r
168 -search-show-thread) (notmuch-test-wait) (message (buffer-string))' 2>&1)\r
169 > +output=3D$(test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) =\r
170 (goto-char (point-min)) (re-search-forward "Working with Maildir") (notmuch=\r
171 -search-show-thread) (notmuch-test-wait) (message "%s" (buffer-string))' 2>=\r
172 &1)\r
173 > =A0test_expect_equal "$output" "$expected"\r
174 >\r
175 > =A0test_begin_subtest "Add tag from search view"\r
176 > @@ -102,7 +102,7 @@ test_expect_equal "$output" "thread:XXX =A0 1974-03-2=\r
177 9 [1/1] Notmuch Test Suite; T\r
178 > =A0test_begin_subtest "Reply within emacs"\r
179 > =A0# We sed away everything before the ^From in the output to avoid getti=\r
180 ng\r
181 > =A0# confused by messages such as "Parsing /home/cworth/.mailrc... done"\r
182 > -output=3D$(test_emacs '(notmuch-search "subject:\"testing message sent v=\r
183 ia SMTP\"") (notmuch-test-wait) (notmuch-search-reply-to-thread) (message (=\r
184 buffer-string))' 2>&1 | sed -ne '/^From/,$ p' | sed -e 's/^In-Reply-To: <.*=\r
185 >$/In-Reply-To: <XXX>/')\r
186 > +output=3D$(test_emacs '(notmuch-search "subject:\"testing message sent v=\r
187 ia SMTP\"") (notmuch-test-wait) (notmuch-search-reply-to-thread) (message "=\r
188 %s" (buffer-string))' 2>&1 | sed -ne '/^From/,$ p' | sed -e 's/^In-Reply-To=\r
189 : <.*>$/In-Reply-To: <XXX>/')\r
190 > =A0test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notm=\r
191 uchmail.org>\r
192 > =A0To: user@example.com\r
193 > =A0Subject: Re: Testing message sent via SMTP\r
194 > @@ -125,7 +125,7 @@ test_expect_equal_file "$EXPECTED/attachment" attachm=\r
195 ent2.gz\r
196 > =A0test_begin_subtest "View raw message within emacs"\r
197 > =A0expected=3D$(cat $EXPECTED/raw-message-cf0c4d-52ad0a)\r
198 > =A0first_line=3D$(echo "$expected" | head -n1)\r
199 > -output=3D$(test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf=\r
200 9aa31f052ad0a@mail.gmail.com") (notmuch-show-view-raw-message) (message (bu=\r
201 ffer-string))' 2>&1 | sed -ne "/$first_line/,\$ p")\r
202 > +output=3D$(test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf=\r
203 9aa31f052ad0a@mail.gmail.com") (notmuch-show-view-raw-message) (message "%s=\r
204 " (buffer-string))' 2>&1 | sed -ne "/$first_line/,\$ p")\r
205 > =A0test_expect_equal "$output" "$expected"\r
206 >\r
207 > =A0test_done\r
208 > diff --git a/test/emacs-large-search-buffer b/test/emacs-large-search-buf=\r
209 fer\r
210 > index a3b5c79..77878b5 100755\r
211 > --- a/test/emacs-large-search-buffer\r
212 > +++ b/test/emacs-large-search-buffer\r
213 > @@ -21,11 +21,12 @@ notmuch new > /dev/null\r
214 > =A0test_begin_subtest "Ensure that emacs doesn't drop results"\r
215 > =A0expected=3D"$(notmuch search '*' | sed -e 's/^thread:[0-9a-f]* =A0//' =\r
216 -e 's/;//' -e =A0's/xx*/[BLOB]/')\r
217 > =A0End of search results."\r
218 > -output=3D$(test_emacs '(notmuch-search "*") (notmuch-test-wait) (message=\r
219  (buffer-string))' 2>&1 | sed -e s', =A0*, ,g' -e 's/xxx*/[BLOB]/g')\r
220 > +\r
221 > +output=3D$(test_emacs '(notmuch-search "*") (notmuch-test-wait) (message=\r
222  "%s" (buffer-string))' 2>&1 | sed -e s', =A0*, ,g' -e 's/xxx*/[BLOB]/g')\r
223 > =A0test_expect_equal "$output" "$expected"\r
224 >\r
225 > =A0test_begin_subtest "Ensure that emacs doesn't drop error messages"\r
226 > -output=3D$(test_emacs '(notmuch-search "--this-option-does-not-exist") (=\r
227 notmuch-test-wait) (message (buffer-string))' 2>&1)\r
228 > +output=3D$(test_emacs '(notmuch-search "--this-option-does-not-exist") (=\r
229 notmuch-test-wait) (message "%s" (buffer-string))' 2>&1)\r
230 > =A0test_expect_equal "$output" "Error: Unexpected output from notmuch sea=\r
231 rch:\r
232 > =A0Unrecognized option: --this-option-does-not-exist\r
233 > =A0End of search results. (process returned 1)"\r
234 > --\r
235 > 1.7.5.1\r
236 >\r
237 > _______________________________________________\r
238 > notmuch mailing list\r
239 > notmuch@notmuchmail.org\r
240 > http://notmuchmail.org/mailman/listinfo/notmuch\r
241 >\r