summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/cluster_tests.py
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
commitc0789fa503a96ee99b44278528d8ef7aa72897f4 (patch)
tree5414579a7bcbeccb19da078dfaba94103ef27d93 /qpid/cpp/src/tests/cluster_tests.py
parent2dadd6d0b6d1906bb39f6da9587a79cf9f3c2234 (diff)
downloadqpid-python-c0789fa503a96ee99b44278528d8ef7aa72897f4.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@927509 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/cluster_tests.py')
-rwxr-xr-xqpid/cpp/src/tests/cluster_tests.py36
1 files changed, 17 insertions, 19 deletions
diff --git a/qpid/cpp/src/tests/cluster_tests.py b/qpid/cpp/src/tests/cluster_tests.py
index 55b36aba46..ead82c5e19 100755
--- a/qpid/cpp/src/tests/cluster_tests.py
+++ b/qpid/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()