--- /dev/null
+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 CD8CE431FAF\r
+ for <notmuch@notmuchmail.org>; Wed, 28 Nov 2012 00:05:15 -0800 (PST)\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 vute5j6ardIq for <notmuch@notmuchmail.org>;\r
+ Wed, 28 Nov 2012 00:05:15 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id C9621431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 28 Nov 2012 00:05:14 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id CC2591000E5;\r
+ Wed, 28 Nov 2012 10:05:12 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: Make the emacsclient binary user-configurable\r
+In-Reply-To: <1354073099-14582-1-git-send-email-amdragon@mit.edu>\r
+References: <1354073099-14582-1-git-send-email-amdragon@mit.edu>\r
+User-Agent: Notmuch/0.14+116~g29fcdb5 (http://notmuchmail.org) Emacs/24.2.1\r
+ (x86_64-unknown-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: Wed, 28 Nov 2012 10:05:12 +0200\r
+Message-ID: <m2zk22w3t3.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Wed, 28 Nov 2012 08:05:15 -0000\r
+\r
+On Wed, Nov 28 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
+\r
+> And require that if TEST_EMACS is specified, so is TEST_EMACSCLIENT.\r
+>\r
+> Previously, the test framework always used "emacsclient", even if the\r
+> Emacs in use was overridden by TEST_EMACS. This causes problems if\r
+> both Emacs 23 and Emacs 24 are installed, the Emacs 23 emacsclient is\r
+> the system default, but TEST_EMACS is set to emacs24. Specifically,\r
+> with an Emacs 24 server and an Emacs 23 client, emacs tests that run\r
+> very quickly may produce no output from emacsclient, causing the test\r
+> to fail.\r
+>\r
+> The Emacs server uses a very simple line-oriented protocol in which\r
+> the client sends a request to evaluate an expression and the server\r
+> sends a request to print the result of evaluation. Prior to Emacs bzr\r
+> commit 107565 on March 11th, 2012 (released in Emacs 24.1), if\r
+> multiple commands were sent to the emacsclient between when it sent\r
+> the evaluation command and when it entered its receive loop, it would\r
+> only process the first response command, ignoring the rest of the\r
+> received buffer. This wasn't a problem with the Emacs 23 server\r
+> because it sent only the command to print the evaluation result.\r
+> However, the Emacs 24 server first sends an unprompted command\r
+> specifying the PID of the Emacs server, then processes the evaluation\r
+> request, then sends the command to print the result. If the\r
+> evaluation is fast enough, it can send both of these commands before\r
+> emacsclient enters the receive loop. Hence, if an Emacs 24 server is\r
+> used with an Emacs 23 emacsclient, it may miss the response printing\r
+> command, ultimately causing intermittent notmuch test failures.\r
+> ---\r
+\r
+Looks good to me (especially commit message)\r
+\r
+I guess buildbot configuration needs to be fixed to set\r
+TEST_EMACSCLIENT too (now that it is possible as it probably\r
+sets TEST_EMACS already...)\r
+\r
+Tomi\r
+\r
+\r
+> test/README | 10 +++++-----\r
+> test/test-lib.sh | 12 +++++++++---\r
+> 2 files changed, 14 insertions(+), 8 deletions(-)\r
+>\r
+> diff --git a/test/README b/test/README\r
+> index 6dc3034..81c232d 100644\r
+> --- a/test/README\r
+> +++ b/test/README\r
+> @@ -69,12 +69,12 @@ can be specified as follows:\r
+> \r
+> make test OPTIONS="--verbose"\r
+> \r
+> -You can choose an emacs binary to run the tests in one of the\r
+> -following ways.\r
+> +You can choose an emacs binary (and corresponding emacsclient) to run\r
+> +the tests in one of the following ways.\r
+> \r
+> - TEST_EMACS=my-special-emacs make test\r
+> - TEST_EMACS=my-special-emacs ./emacs\r
+> - make test TEST_EMACS=my-special-emacs\r
+> + TEST_EMACS=my-special-emacs TEST_EMACSCLIENT=my-emacsclient make test\r
+> + TEST_EMACS=my-special-emacs TEST_EMACSCLIENT=my-emacsclient ./emacs\r
+> + make test TEST_EMACS=my-special-emacs TEST_EMACSCLIENT=my-emacsclient\r
+> \r
+> Skipping Tests\r
+> --------------\r
+> diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+> index 467b83c..e092231 100644\r
+> --- a/test/test-lib.sh\r
+> +++ b/test/test-lib.sh\r
+> @@ -49,7 +49,13 @@ TZ=UTC\r
+> TERM=dumb\r
+> export LANG LC_ALL PAGER TERM TZ\r
+> GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}\r
+> +if [[ ( -n "$TEST_EMACS" && -z "$TEST_EMACSCLIENT" ) || \\r
+> + ( -z "$TEST_EMACS" && -n "$TEST_EMACSCLIENT" ) ]]; then\r
+> + echo "error: must specify both or neither of TEST_EMACS and TEST_EMACSCLIENT" >&2\r
+> + exit 1\r
+> +fi\r
+> TEST_EMACS=${TEST_EMACS:-${EMACS:-emacs}}\r
+> +TEST_EMACSCLIENT=${TEST_EMACSCLIENT:-emacsclient}\r
+> \r
+> # Protect ourselves from common misconfiguration to export\r
+> # CDPATH into the environment\r
+> @@ -969,7 +975,7 @@ test_emacs () {\r
+> missing_dependencies=\r
+> test_require_external_prereq dtach || missing_dependencies=1\r
+> test_require_external_prereq emacs || missing_dependencies=1\r
+> - test_require_external_prereq emacsclient || missing_dependencies=1\r
+> + test_require_external_prereq ${TEST_EMACSCLIENT} || missing_dependencies=1\r
+> test -z "$missing_dependencies" || return\r
+> \r
+> if [ -z "$EMACS_SERVER" ]; then\r
+> @@ -1005,7 +1011,7 @@ test_emacs () {\r
+> rm -f OUTPUT\r
+> touch OUTPUT\r
+> \r
+> - emacsclient --socket-name="$EMACS_SERVER" --eval "(progn $@)"\r
+> + ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(progn $@)"\r
+> }\r
+> \r
+> test_python() {\r
+> @@ -1158,7 +1164,7 @@ rm -f y\r
+> # declare prerequisites for external binaries used in tests\r
+> test_declare_external_prereq dtach\r
+> test_declare_external_prereq emacs\r
+> -test_declare_external_prereq emacsclient\r
+> +test_declare_external_prereq ${TEST_EMACSCLIENT}\r
+> test_declare_external_prereq gdb\r
+> test_declare_external_prereq gpg\r
+> test_declare_external_prereq python\r
+> -- \r
+> 1.7.10.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r