diff options
| author | Alan Conway <aconway@apache.org> | 2010-08-10 14:10:51 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2010-08-10 14:10:51 +0000 |
| commit | 01bb39c55e92380f90f7f9bb1a2e74906d455b08 (patch) | |
| tree | 08d40025be869549986363f2ec1c547ab4fe162f /qpid/cpp/src/tests/cluster_tests.py | |
| parent | abe3cdd9b1c10a7ace5c10ff660f1a8ad4664b86 (diff) | |
| download | qpid-python-01bb39c55e92380f90f7f9bb1a2e74906d455b08.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@984017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/cluster_tests.py')
| -rwxr-xr-x | qpid/cpp/src/tests/cluster_tests.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/qpid/cpp/src/tests/cluster_tests.py b/qpid/cpp/src/tests/cluster_tests.py index 00cd98a20a..b4fa510528 100755 --- a/qpid/cpp/src/tests/cluster_tests.py +++ b/qpid/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 |
