[PATCH 1/2] test: emacs: call accept-process-output in notmuch-test-wait
authorTomi Ollila <tomi.ollila@iki.fi>
Sun, 5 Aug 2012 11:13:01 +0000 (14:13 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:51 +0000 (09:48 -0800)
7b/140cde62bee9820d1a55bd8f0120d63f3b381a [new file with mode: 0644]

diff --git a/7b/140cde62bee9820d1a55bd8f0120d63f3b381a b/7b/140cde62bee9820d1a55bd8f0120d63f3b381a
new file mode 100644 (file)
index 0000000..63dcbe2
--- /dev/null
@@ -0,0 +1,86 @@
+Return-Path: <too@guru-group.fi>\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 E7795431FAF\r
+       for <notmuch@notmuchmail.org>; Sun,  5 Aug 2012 04:12:54 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 O7mEmzNGOa47 for <notmuch@notmuchmail.org>;\r
+       Sun,  5 Aug 2012 04:12:54 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 43741431FAE\r
+       for <notmuch@notmuchmail.org>; Sun,  5 Aug 2012 04:12:54 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id B59221002A4; Sun,  5 Aug 2012 14:13:04 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] test: emacs: call accept-process-output in\r
+       notmuch-test-wait\r
+Date: Sun,  5 Aug 2012 14:13:01 +0300\r
+Message-Id: <1344165182-29246-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.1\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\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, 05 Aug 2012 11:12:55 -0000\r
+\r
+notmuch-test-wait called sleep-for in a loop to wait unconditionally 0.1\r
+seconds while waiting for process to exit.\r
+accept-process-output returns as soon as there is any data available\r
+from process, so using it avoids unnecessary fixed delays.\r
+Both of these functions run process sentinels.\r
+---\r
+\r
+This 2 patch series is an alternative to \r
+id:"1344122222-14344-1-git-send-email-tomi.ollila@iki.fi"\r
+which speeds up execution when Emacs version is not 23.1.\r
+(so that users of newer emacs doesn't need to suffer the\r
+workaround made for emacs 23.1 users in second patch in\r
+this series)\r
+\r
+during testing of the feature I had\r
++    (accept-process-output nil 10)))\r
+there -- it did not wait 10 seconds.\r
+\r
+I also tested the following function:\r
+\r
+(defun notmuch-test-wait () t)\r
+\r
+i.e. dropping wait altogether -- this makes tests fail in different ways...\r
+\r
+ test/test-lib.el |    2 +-\r
+ 1 files changed, 1 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/test/test-lib.el b/test/test-lib.el\r
+index 5dd6271..52d9936 100644\r
+--- a/test/test-lib.el\r
++++ b/test/test-lib.el\r
+@@ -38,7 +38,7 @@\r
+ (defun notmuch-test-wait ()\r
+   "Wait for process completion."\r
+   (while (get-buffer-process (current-buffer))\r
+-    (sleep-for 0.1)))\r
++    (accept-process-output nil 0.1)))\r
\r
+ (defun test-output (&optional filename)\r
+   "Save current buffer to file FILENAME.  Default FILENAME is OUTPUT."\r
+-- \r
+1.7.1\r
+\r