Re: [PATCH 2/2] test: emacs: run list-processes after accept-process-output in emacs...
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 16 Aug 2012 07:44:05 +0000 (10:44 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:07 +0000 (09:49 -0800)
30/4ab19f26f02432f5c585989d04122bcaa7bb37 [new file with mode: 0644]

diff --git a/30/4ab19f26f02432f5c585989d04122bcaa7bb37 b/30/4ab19f26f02432f5c585989d04122bcaa7bb37
new file mode 100644 (file)
index 0000000..2d15410
--- /dev/null
@@ -0,0 +1,125 @@
+Return-Path: <tomi.ollila@iki.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 7F294431FC2\r
+       for <notmuch@notmuchmail.org>; Thu, 16 Aug 2012 00:43:58 -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 V6++5BcyRtxs for <notmuch@notmuchmail.org>;\r
+       Thu, 16 Aug 2012 00:43:57 -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 99683431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 16 Aug 2012 00:43:57 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 48749100637; Thu, 16 Aug 2012 10:44:05 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Austin Clements <amdragon@MIT.EDU>\r
+Subject: Re: [PATCH 2/2] test: emacs: run list-processes after\r
+       accept-process-output in emacs 23.1\r
+In-Reply-To: <20120813151613.GN11179@mit.edu>\r
+References: <1344165182-29246-1-git-send-email-tomi.ollila@iki.fi>\r
+       <1344165182-29246-2-git-send-email-tomi.ollila@iki.fi>\r
+       <20120813151613.GN11179@mit.edu>\r
+User-Agent: Notmuch/0.13.2+128~g2eb637a (http://notmuchmail.org) Emacs/23.1.1\r
+       (x86_64-redhat-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Thu, 16 Aug 2012 10:44:05 +0300\r
+Message-ID: <m27gsz2se2.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: notmuch@notmuchmail.org\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: Thu, 16 Aug 2012 07:43:58 -0000\r
+\r
+On Mon, Aug 13 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
+\r
+> Quoth Tomi Ollila on Aug 05 at  2:13 pm:\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 sentinel\r
+>> \r
+>> It seems this is present in emacs 23.1.\r
+>> \r
+>> Calling list-processes after accept-process-output seems work around\r
+>> this problem; in case Emacs version is 23.1 a defadvice is activated\r
+>> to do just that.\r
+>\r
+> Should this workaround perhaps go in notmuch-test-wait directly,\r
+> instead of being implemented as advice?  \r
+\r
+This way the fact that this is workaround for bug that exists only in\r
+23.1(*) is emphasized; The notmuch-test-wait can exist in a (simpler)\r
+format where it doesn't need to know about this bug.\r
+\r
+(*) This bug probably exists in emacs 22 but the MUA has not worked\r
+on emacs 22 at least for a year now.\r
+\r
+> If we do want to keep it as advice, should it go in notmuch-lib.el\r
+> along with the few other compatibility functions?\r
+\r
+In tests we have fixed environment where we can write workarounds\r
+as "global" advices. If we did this in notmuch-lib.el we'd be changing\r
+users' environment, possibly causing surprises...\r
+\r
+... but neither sleep-for or accept-process-output are used in \r
+any of the notmuch elisp code so such "fixes" are not needed now...\r
+\r
+... and this would ever be a problem, we might already support only\r
+emacs 24 or newer >;) ...\r
+\r
+Tomi\r
+\r
+>> ---\r
+>> \r
+>> Thanks to Austin for the comments and IRC discussions on the matter.\r
+>> \r
+>>  test/test-lib.el |    8 ++++++++\r
+>>  1 files changed, 8 insertions(+), 0 deletions(-)\r
+>> \r
+>> diff --git a/test/test-lib.el b/test/test-lib.el\r
+>> index 52d9936..4330352 100644\r
+>> --- a/test/test-lib.el\r
+>> +++ b/test/test-lib.el\r
+>> @@ -35,6 +35,16 @@\r
+>>      "Disable yes-or-no-p before executing kill-emacs"\r
+>>      (defun yes-or-no-p (prompt) t)))\r
+>>  \r
+>> +;; Emacs bug #2930:\r
+>> +;; 23.0.92; `accept-process-output' and `sleep-for' do not run sentinels\r
+>> +;; seems to be present in Emacs 23.1.\r
+>> +;; Running `list-processes' after `accept-process-output' seems to work\r
+>> +;; around this problem.\r
+>> +(if (and (= emacs-major-version 23) (= emacs-minor-version 1))\r
+>> +  (defadvice accept-process-output (after run-list-processes activate)\r
+>> +    "run list-processes after executing accept-process-output"\r
+>> +    (list-processes)))\r
+>> +\r
+>>  (defun notmuch-test-wait ()\r
+>>    "Wait for process completion."\r
+>>    (while (get-buffer-process (current-buffer))\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r