diff options
author | Alan Conway <aconway@apache.org> | 2010-06-23 20:56:30 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2010-06-23 20:56:30 +0000 |
commit | 22a5da985666df9ea6d614fb56fb28a8f4d794a3 (patch) | |
tree | 6bd2e75c61cfc8d0c75863a52a66831d2bab3b93 /cpp/src | |
parent | ce8b64f74c8f35868fd6b982be260f094f8889b7 (diff) | |
download | qpid-python-22a5da985666df9ea6d614fb56fb28a8f4d794a3.tar.gz |
Make management+cluster test more aggressive.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@957337 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 3 | ||||
-rwxr-xr-x | cpp/src/tests/cluster_tests.py | 19 | ||||
-rwxr-xr-x | cpp/src/tests/run_cluster_tests | 2 |
3 files changed, 11 insertions, 13 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index bc755e3498..1e4d58032a 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -71,7 +71,8 @@ struct ConnectionTimeoutTask : public sys::TimerTask { void fire() { // If we get here then we've not received any traffic in the timeout period // Schedule closing the connection for the io thread - QPID_LOG(error, "Connection timed out: closing"); + QPID_LOG(error, "Connection " << connection.getMgmtId() + << " timed out: closing"); connection.abort(); } }; diff --git a/cpp/src/tests/cluster_tests.py b/cpp/src/tests/cluster_tests.py index 944de96fb5..79001585f2 100755 --- a/cpp/src/tests/cluster_tests.py +++ b/cpp/src/tests/cluster_tests.py @@ -260,34 +260,31 @@ class LongTests(BrokerTest): if BrokerTest.store_lib: args +=["--load-module", BrokerTest.store_lib] cluster = self.cluster(3, args) - clients = [] # Ordinary clients that only connect to one broker. + clients = [] # Per-broker list of clients that only connect to one broker. mclients = [] # Management clients that connect to every broker in the cluster. - def start_clients(broker, i): - """Start ordinary clients for a broker. Start one client per broker. - Round-robin on a colllection of different clients.""" + def start_clients(broker): + """Start ordinary clients for a broker.""" cmds=[ ["qpid-tool", "localhost:%s"%(broker.port())], ["qpid-perftest", "--count", 50000, "--base-name", str(qpid.datatypes.uuid4()), "--port", broker.port()], ["qpid-queue-stats", "-a", "localhost:%s" %(broker.port())], ["testagent", "localhost", str(broker.port())] ] - clients.append([ClientLoop(broker, cmds[i%len(cmds)])]) + clients.append([ClientLoop(broker, cmd) for cmd in cmds]) def start_mclients(broker): """Start management clients that make multiple connections.""" cmd = ["qpid-stat", "-b", "localhost:%s" %(broker.port())] mclients.append(ClientLoop(broker, cmd)) - duration = max(self.duration(), 5) - endtime = time.time() + duration + endtime = time.time() + self.duration() alive = 0 # First live cluster member - for i in range(len(cluster)): - start_clients(cluster[i], i) + for i in range(len(cluster)): start_clients(cluster[i]) start_mclients(cluster[alive]) while time.time() < endtime: - time.sleep(min(5,duration/2)) + time.sleep(max(5,self.duration()/4)) for b in cluster[alive:]: b.ready() # Check if a broker crashed. # Kill the first broker, expect the clients to fail. for c in clients[alive] + mclients: c.expect_fail() @@ -301,7 +298,7 @@ class LongTests(BrokerTest): # Start another broker and clients alive += 1 cluster.start() - start_clients(cluster[-1], len(cluster)-1) + start_clients(cluster[-1]) start_mclients(cluster[alive]) for c in chain(mclients, *clients): c.stop() diff --git a/cpp/src/tests/run_cluster_tests b/cpp/src/tests/run_cluster_tests index 1b8715367e..e136d3810a 100755 --- a/cpp/src/tests/run_cluster_tests +++ b/cpp/src/tests/run_cluster_tests @@ -25,7 +25,7 @@ source $srcdir/ais_check test -x $QPID_PYTHON_TEST || { echo Skipping test, $QPID_PYTHON_TEST not found; exit 0; } # Delete old cluster test data -OUTDIR=brokertest.tmp +OUTDIR=${OUTDIR:-brokertest.tmp} rm -rf $OUTDIR mkdir -p $OUTDIR |