summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-03-25 17:19:31 +0000
committerAlan Conway <aconway@apache.org>2010-03-25 17:19:31 +0000
commitc44d59ff549867145281b94f87bcfad3c4aa8e69 (patch)
treef1b2333ed036039df6f1ff28e2248fe6c8756162 /cpp/src
parent8fd370f84c72fb92a4cbb2de59073ad7f68feef3 (diff)
downloadqpid-python-c44d59ff549867145281b94f87bcfad3c4aa8e69.tar.gz
Re-eneable run_long_cluster_tests.
Reduced duration to 2 minutes per test. Reduced load to avoid timeouts - Fewer concurrent clients on test_management. - Delay in ErrorGenerator for test_failover. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@927509 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/tests/cluster.mk1
-rwxr-xr-xcpp/src/tests/cluster_tests.py36
-rwxr-xr-xcpp/src/tests/run_long_cluster_tests3
3 files changed, 20 insertions, 20 deletions
diff --git a/cpp/src/tests/cluster.mk b/cpp/src/tests/cluster.mk
index d2b454bb8e..0c142a6727 100644
--- a/cpp/src/tests/cluster.mk
+++ b/cpp/src/tests/cluster.mk
@@ -60,6 +60,7 @@ EXTRA_DIST += \
cluster_tests.fail
LONG_TESTS += \
+ run_long_cluster_tests \
start_cluster \
cluster_python_tests \
stop_cluster
diff --git a/cpp/src/tests/cluster_tests.py b/cpp/src/tests/cluster_tests.py
index 55b36aba46..ead82c5e19 100755
--- a/cpp/src/tests/cluster_tests.py
+++ b/cpp/src/tests/cluster_tests.py
@@ -230,46 +230,44 @@ class LongTests(BrokerTest):
clients = [] # Ordinary clients that only connect to one broker.
mclients = [] # Management clients that connect to every broker in the cluster.
- def start_clients(broker):
- """Start ordinary clients for a broker"""
- batch = []
- for cmd in [
+ def start_clients(broker, i):
+ """Start ordinary clients for a broker. Start one client per broker.
+ Round-robin on a colllection of different clients."""
+ cmds=[
["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())] ]:
- batch.append(ClientLoop(broker, cmd))
- clients.append(batch)
+ ["testagent", "localhost", str(broker.port())] ]
+ clients.append([ClientLoop(broker, cmds[i%len(cmds)])])
def start_mclients(broker):
- """Start management clients that make multiple connections"""
- for cmd in [
- ["qpid-stat", "-b", "localhost:%s" %(broker.port())]
- ]:
- mclients.append(ClientLoop(broker, cmd))
+ """Start management clients that make multiple connections."""
+ cmd = ["qpid-stat", "-b", "localhost:%s" %(broker.port())]
+ mclients.append(ClientLoop(broker, cmd))
endtime = time.time() + self.duration()
alive = 0 # First live cluster member
- for b in cluster:
- start_clients(b)
- start_mclients(b)
+ for i in range(len(cluster)):
+ start_clients(cluster[i], i)
+ start_mclients(cluster[alive])
while time.time() < endtime:
time.sleep(min(5,self.duration()/2))
for b in cluster[alive:]: b.ready() # Check if a broker crashed.
- # Kill the first broker. Ignore errors on its clients and all the mclients
+ # Kill the first broker, expect the clients to fail.
for c in clients[alive] + mclients: c.expect_fail()
b = cluster[alive]
b.expect = EXPECT_EXIT_FAIL
b.kill()
+ # Stop the brokers clients and all the mclients.
for c in clients[alive] + mclients: c.stop()
clients[alive] = []
mclients = []
# Start another broker and clients
alive += 1
- b = cluster.start()
- start_clients(b)
- for b in cluster[alive:]: start_mclients(b)
+ cluster.start()
+ start_clients(cluster[-1], len(cluster)-1)
+ start_mclients(cluster[alive])
for c in chain(mclients, *clients):
c.stop()
diff --git a/cpp/src/tests/run_long_cluster_tests b/cpp/src/tests/run_long_cluster_tests
index 81d4019616..05c7867e2e 100755
--- a/cpp/src/tests/run_long_cluster_tests
+++ b/cpp/src/tests/run_long_cluster_tests
@@ -20,4 +20,5 @@
#
srcdir=`dirname $0`
-$srcdir/run_cluster_tests 'cluster_tests.LongTests.*' -DDURATION=5
+$srcdir/run_cluster_tests 'cluster_tests.LongTests.*' -DDURATION=2
+