unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: notmuch@notmuchmail.org
Cc: Tomi Ollila <tomi.ollila@iki.fi>
Subject: [PATCH 1/2] test: emacs: call accept-process-output in notmuch-test-wait
Date: Sun,  5 Aug 2012 14:13:01 +0300	[thread overview]
Message-ID: <1344165182-29246-1-git-send-email-tomi.ollila@iki.fi> (raw)

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

             reply	other threads:[~2012-08-05 11:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05 11:13 Tomi Ollila [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344165182-29246-1-git-send-email-tomi.ollila@iki.fi \
    --to=tomi.ollila@iki.fi \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).