Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 77C269236 for ; Thu, 13 Oct 2011 19:08:00 +0000 (UTC) Received: (qmail 43807 invoked by uid 500); 13 Oct 2011 19:08:00 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 43784 invoked by uid 500); 13 Oct 2011 19:08:00 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 43777 invoked by uid 99); 13 Oct 2011 19:08:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2011 19:08:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2011 19:07:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DB303238888F for ; Thu, 13 Oct 2011 19:07:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1183029 - /qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark Date: Thu, 13 Oct 2011 19:07:36 -0000 To: commits@qpid.apache.org From: aconway@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111013190736.DB303238888F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: aconway Date: Thu Oct 13 19:07:36 2011 New Revision: 1183029 URL: http://svn.apache.org/viewvc?rev=1183029&view=rev Log: QPID-2920: Improved error messages from qpid-cpp-benchmark. Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark?rev=1183029&r1=1183028&r2=1183029&view=diff ============================================================================== --- qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark (original) +++ qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark Thu Oct 13 19:07:36 2011 @@ -94,6 +94,12 @@ class Clients: try: c.kill() except: pass +class PopenCommand(Popen): + """Like Popen but you can query for the command""" + def __init__(self, command, *args, **kwargs): + self.command = command + Popen.__init__(self, command, *args, **kwargs) + clients = Clients() def start_receive(queue, index, opts, ready_queue, broker, host): @@ -123,7 +129,7 @@ def start_receive(queue, index, opts, re command += ["--connection-options",opts.connection_options] if host: command = ssh_command(host, command) if opts.verbose: print "Receiver: ", command - return clients.add(Popen(command, stdout=PIPE, stderr=PIPE)) + return clients.add(PopenCommand(command, stdout=PIPE, stderr=PIPE)) def start_send(queue, opts, broker, host): address="%s;{%s}"%(queue,",".join(opts.send_option + ["create:always"])) @@ -145,7 +151,7 @@ def start_send(queue, opts, broker, host command += ["--connection-options",opts.connection_options] if host: command = ssh_command(host, command) if opts.verbose: print "Sender: ", command - return clients.add(Popen(command, stdout=PIPE, stderr=PIPE)) + return clients.add(PopenCommand(command, stdout=PIPE, stderr=PIPE)) def error_msg(out, err): return ("\n[stdout]\n%s\n[stderr]\n%s[end]"%(out, err)) @@ -243,7 +249,8 @@ class ReadyReceiver: for r in receivers: if (r.poll() is not None): out,err=r.communicate() - raise Exception("Receiver error: %s"%error_msg(out,err)) + raise Exception("Receiver error: %s\n%s" % + (" ".join(r.command), error_msg(out,err))) raise Exception("Timed out waiting for receivers to be ready") def flatten(l): --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscribe@qpid.apache.org