unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] test: emacs: call accept-process-output in notmuch-test-wait
@ 2012-08-05 11:13 Tomi Ollila
  2012-08-05 11:13 ` [PATCH 2/2] test: emacs: run list-processes after accept-process-output in emacs 23.1 Tomi Ollila
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tomi Ollila @ 2012-08-05 11:13 UTC (permalink / raw)
  To: notmuch; +Cc: Tomi Ollila

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.
---

This 2 patch series is an alternative to 
id:"1344122222-14344-1-git-send-email-tomi.ollila@iki.fi"
which speeds up execution when Emacs version is not 23.1.
(so that users of newer emacs doesn't need to suffer the
workaround made for emacs 23.1 users in second patch in
this series)

during testing of the feature I had
+    (accept-process-output nil 10)))
there -- it did not wait 10 seconds.

I also tested the following function:

(defun notmuch-test-wait () t)

i.e. dropping wait altogether -- this makes tests fail in different ways...

 test/test-lib.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/test/test-lib.el b/test/test-lib.el
index 5dd6271..52d9936 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -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."
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-29 22:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-05 11:13 [PATCH 1/2] test: emacs: call accept-process-output in notmuch-test-wait Tomi Ollila
2012-08-05 11:13 ` [PATCH 2/2] test: emacs: run list-processes after accept-process-output in emacs 23.1 Tomi Ollila
2012-08-13 15:16   ` Austin Clements
2012-08-16  7:44     ` Tomi Ollila
2012-08-17 18:55       ` Austin Clements
2012-08-05 21:41 ` [PATCH 1/2] test: emacs: call accept-process-output in notmuch-test-wait Jameson Graef Rollins
2012-08-29 22:11 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).