summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-08-10 14:10:51 +0000
committerAlan Conway <aconway@apache.org>2010-08-10 14:10:51 +0000
commit3b71d152920d469f41dce1ab2a7f516053e98994 (patch)
tree2cdba971d1f202846cf3aa2123160c12394d7189 /cpp
parent7aebb95c7c7d47ef0a991a4a7ed737d1e1a7c1fb (diff)
downloadqpid-python-3b71d152920d469f41dce1ab2a7f516053e98994.tar.gz
Fix test race conditions causing cluster_tests.py:management_test to hang.
Got rid of expect_fail, ignore exceptions in the caller. Avoid concurrent calls to _cleanup, call only from from wait/poll. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@984017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/src/tests/cluster_tests.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/cpp/src/tests/cluster_tests.py b/cpp/src/tests/cluster_tests.py
index 00cd98a20a..b4fa510528 100755
--- a/cpp/src/tests/cluster_tests.py
+++ b/cpp/src/tests/cluster_tests.py
@@ -259,7 +259,6 @@ 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):
@@ -284,19 +283,13 @@ class LongTests(BrokerTest):
try:
# Quit and ignore errors if stopped or expecting failure.
if self.stopped: break
- if not self._expect_fail and exit != 0:
+ if exit != 0:
self.process.unexpected(
"client of %s exit code %s"%(self.broker.name, exit))
finally: self.lock.release()
except Exception, e:
self.error = RethrownException("Error in ClientLoop.run")
- def expect_fail(self):
- """Ignore exit status of the currently running client."""
- self.lock.acquire()
- self._expect_fail = True
- self.lock.release()
-
def stop(self):
"""Stop the running client and wait for it to exit"""
self.lock.acquire()
@@ -342,12 +335,13 @@ class LongTests(BrokerTest):
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()
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()
+ # Stop the brokers clients and all the mclients.
+ for c in clients[alive] + mclients:
+ try: c.stop()
+ except: pass # Ignore expected errors due to broker shutdown.
clients[alive] = []
mclients = []
# Start another broker and clients