Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1E984431FAF for ; Sat, 4 Aug 2012 16:16:56 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rIUbfq9C3DbU for ; Sat, 4 Aug 2012 16:16:55 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 55541431FAE for ; Sat, 4 Aug 2012 16:16:55 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 41D8F100372; Sun, 5 Aug 2012 02:17:04 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH v2] test: test-lib.el: replace sleep-for with sit-for in notmuch-test-wait Date: Sun, 5 Aug 2012 02:17:02 +0300 Message-Id: <1344122222-14344-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1343996163-26720-1-git-send-email-tomi.ollila@iki.fi> References: <1343996163-26720-1-git-send-email-tomi.ollila@iki.fi> Cc: Tomi Ollila X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2012 23:16:56 -0000 When running emacs tests using emacs 23.1.1 the tests block (until timeout) when emacs function (notmuch-test-wait) is called. There is an emacs bug #2930 titled: 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels It seems this is still active in emacs 23.1; replacing sleep-for with sit-for makes the tests work as expected. The other function in loop executed in notmuch-test-wait: get-buffer-process just loops through process list, returning matching process object (or nil if no such process found) without doing any further processing. By comparing Emacs 23.1 and 23.2 function wait_reading_process_output () (changes in do_display variable usage) it seems that this bug has been fixed in 23.2. --- test/test-lib.el | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/test/test-lib.el b/test/test-lib.el index 5dd6271..30d6eb7 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -38,7 +38,11 @@ (defun notmuch-test-wait () "Wait for process completion." (while (get-buffer-process (current-buffer)) - (sleep-for 0.1))) + ;; It seems in Emacs 23.1 `accept-process-output' and `sleep-for' do not + ;; run sentinels (bug#2930 (bug-gnu-emacs)). `sit-for' works as documented. + ;; `sleep-for` may already work in Emacs 23.2 as function + ;; wait_reading_process_output() in src/process.c has related change. + (sit-for 0.1))) (defun test-output (&optional filename) "Save current buffer to file FILENAME. Default FILENAME is OUTPUT." -- 1.7.1