]> git.notmuchmail.org Git - notmuch/commitdiff
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)
committerDavid Bremner <bremner@debian.org>
Wed, 29 Aug 2012 22:06:07 +0000 (19:06 -0300)
notmuch-test-wait called sleep-for in a loop to wait unconditionally 0.1
seconds while waiting for process to exit.
accept-process-output returns as soon as there is any data available
from process, so using it avoids unnecessary fixed delays.
Both of these functions run process sentinels.

test/test-lib.el

index 5dd6271c99dceb16417d947b87a731874d7c7c72..52d993617ff0d910e9abcb5d60564e5bc8dc602a 100644 (file)
@@ -38,7 +38,7 @@
 (defun notmuch-test-wait ()
   "Wait for process completion."
   (while (get-buffer-process (current-buffer))
-    (sleep-for 0.1)))
+    (accept-process-output nil 0.1)))
 
 (defun test-output (&optional filename)
   "Save current buffer to file FILENAME.  Default FILENAME is OUTPUT."