[PATCH v2] test: test-lib.el: replace sleep-for with sit-for in notmuch-test-wait
authorTomi Ollila <tomi.ollila@iki.fi>
Sat, 4 Aug 2012 23:17:02 +0000 (02:17 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:50 +0000 (09:48 -0800)
08/9aa5f2e4bb794df98bf62f77b2c72b8bf0c1d7 [new file with mode: 0644]

diff --git a/08/9aa5f2e4bb794df98bf62f77b2c72b8bf0c1d7 b/08/9aa5f2e4bb794df98bf62f77b2c72b8bf0c1d7
new file mode 100644 (file)
index 0000000..1e9ca51
--- /dev/null
@@ -0,0 +1,85 @@
+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 1E984431FAF\r
+       for <notmuch@notmuchmail.org>; Sat,  4 Aug 2012 16:16:56 -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 rIUbfq9C3DbU for <notmuch@notmuchmail.org>;\r
+       Sat,  4 Aug 2012 16:16:55 -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 55541431FAE\r
+       for <notmuch@notmuchmail.org>; Sat,  4 Aug 2012 16:16:55 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 41D8F100372; Sun,  5 Aug 2012 02:17:04 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2] test: test-lib.el: replace sleep-for with sit-for in\r
+       notmuch-test-wait\r
+Date: Sun,  5 Aug 2012 02:17:02 +0300\r
+Message-Id: <1344122222-14344-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.1\r
+In-Reply-To: <1343996163-26720-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1343996163-26720-1-git-send-email-tomi.ollila@iki.fi>\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: Sat, 04 Aug 2012 23:16:56 -0000\r
+\r
+When running emacs tests using emacs 23.1.1 the tests block (until timeout)\r
+when emacs function (notmuch-test-wait) is called.\r
+\r
+There is an emacs bug #2930 titled:\r
+23.0.92; `accept-process-output' and `sleep-for' do not run sentinels\r
+\r
+It seems this is still active in emacs 23.1; replacing sleep-for with\r
+sit-for makes the tests work as expected.\r
+\r
+The other function in loop executed in notmuch-test-wait: get-buffer-process\r
+just loops through process list, returning matching process object (or nil\r
+if no such process found) without doing any further processing.\r
+\r
+By comparing Emacs 23.1 and 23.2 function wait_reading_process_output ()\r
+(changes in do_display variable usage) it seems that this bug has been\r
+fixed in 23.2.\r
+---\r
+ test/test-lib.el |    6 +++++-\r
+ 1 files changed, 5 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/test/test-lib.el b/test/test-lib.el\r
+index 5dd6271..30d6eb7 100644\r
+--- a/test/test-lib.el\r
++++ b/test/test-lib.el\r
+@@ -38,7 +38,11 @@\r
+ (defun notmuch-test-wait ()\r
+   "Wait for process completion."\r
+   (while (get-buffer-process (current-buffer))\r
+-    (sleep-for 0.1)))\r
++    ;; It seems in Emacs 23.1 `accept-process-output' and `sleep-for' do not\r
++    ;; run sentinels (bug#2930 (bug-gnu-emacs)). `sit-for' works as documented.\r
++    ;; `sleep-for` may already work in Emacs 23.2 as function\r
++    ;; wait_reading_process_output() in src/process.c has related change.\r
++    (sit-for 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