From ff346c19aa68b458eabde29c6a3fbfb24a0fd378 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 4 Aug 2010 15:46:20 +0000 Subject: Fix race conditions in brokertest.py and cluster_tests.py. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@982309 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/cluster_tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/tests/cluster_tests.py b/qpid/cpp/src/tests/cluster_tests.py index 57f3727a13..00cd98a20a 100755 --- a/qpid/cpp/src/tests/cluster_tests.py +++ b/qpid/cpp/src/tests/cluster_tests.py @@ -23,7 +23,7 @@ from qpid import datatypes, messaging from qpid.brokertest import * from qpid.harness import Skipped from qpid.messaging import Message -from threading import Thread +from threading import Thread, Lock from logging import getLogger from itertools import chain @@ -251,7 +251,6 @@ class LongTests(BrokerTest): def test_management(self): """Stress test: Run management clients and other clients concurrently.""" - # TODO aconway 2010-03-03: move to brokertest framework class ClientLoop(StoppableThread): """Run a client executable in a loop.""" def __init__(self, broker, cmd): @@ -301,8 +300,8 @@ class LongTests(BrokerTest): def stop(self): """Stop the running client and wait for it to exit""" self.lock.acquire() - if self.stopped: return try: + if self.stopped: return self.stopped = True if self.process: try: self.process.kill() # Kill the client. -- cgit v1.2.1