summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-03-24 18:56:33 +0000
committerAlan Conway <aconway@apache.org>2010-03-24 18:56:33 +0000
commit7e5f97c73b1909fbe6245efd5e9da28e6250c7a7 (patch)
tree6d0d121fb04bc1d1f85d26af3da1a81550f26f5e /cpp/src/tests
parentb5d1ef6d40dced4d81d6e57b3ec748f4ac9284ee (diff)
downloadqpid-python-7e5f97c73b1909fbe6245efd5e9da28e6250c7a7.tar.gz
Fix resource leaks in cluster_tests, add 5 minute test run to make check-long.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@927154 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rwxr-xr-xcpp/src/tests/cluster_tests.py15
-rwxr-xr-xcpp/src/tests/run_long_cluster_tests2
2 files changed, 10 insertions, 7 deletions
diff --git a/cpp/src/tests/cluster_tests.py b/cpp/src/tests/cluster_tests.py
index 4fefe26db3..55b36aba46 100755
--- a/cpp/src/tests/cluster_tests.py
+++ b/cpp/src/tests/cluster_tests.py
@@ -160,7 +160,7 @@ class LongTests(BrokerTest):
for i in range(i, len(cluster)): cluster[i].kill()
def test_management(self):
- """Run management clients and other clients concurrently."""
+ """Stress test: Run management clients and other clients concurrently."""
# TODO aconway 2010-03-03: move to brokertest framework
class ClientLoop(StoppableThread):
@@ -171,6 +171,7 @@ class LongTests(BrokerTest):
self.cmd = cmd # Client command.
self.lock = Lock()
self.process = None # Client process.
+ self._expect_fail = False
self.start()
def run(self):
@@ -195,7 +196,7 @@ class LongTests(BrokerTest):
try:
# Quit and ignore errors if stopped or expecting failure.
if self.stopped: break
- if exit != 0:
+ if not self._expect_fail and exit != 0:
self.process.unexpected(
"client of %s exit code %s"%(self.broker.name, exit))
finally: self.lock.release()
@@ -205,12 +206,13 @@ class LongTests(BrokerTest):
def expect_fail(self):
"""Ignore exit status of the currently running client."""
self.lock.acquire()
- stopped = True
+ self._expect_fail = True
self.lock.release()
def stop(self):
"""Stop the running client and wait for it to exit"""
self.lock.acquire()
+ if self.stopped: return
try:
self.stopped = True
if self.process:
@@ -232,7 +234,7 @@ class LongTests(BrokerTest):
"""Start ordinary clients for a broker"""
batch = []
for cmd in [
- ["perftest", "--count", 1000,
+ ["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())] ]:
@@ -257,11 +259,12 @@ class LongTests(BrokerTest):
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
for c in clients[alive] + mclients: c.expect_fail()
- clients[alive] = []
- mclients = []
b = cluster[alive]
b.expect = EXPECT_EXIT_FAIL
b.kill()
+ for c in clients[alive] + mclients: c.stop()
+ clients[alive] = []
+ mclients = []
# Start another broker and clients
alive += 1
b = cluster.start()
diff --git a/cpp/src/tests/run_long_cluster_tests b/cpp/src/tests/run_long_cluster_tests
index cb9c6b219b..81d4019616 100755
--- a/cpp/src/tests/run_long_cluster_tests
+++ b/cpp/src/tests/run_long_cluster_tests
@@ -20,4 +20,4 @@
#
srcdir=`dirname $0`
-$srcdir/run_cluster_tests long_cluster_tests
+$srcdir/run_cluster_tests 'cluster_tests.LongTests.*' -DDURATION=5