summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-02-17 04:54:03 +0000
committerRafael H. Schloming <rhs@apache.org>2010-02-17 04:54:03 +0000
commit6056ab3b3de9dedf6765b79a643eb40f8d62ed90 (patch)
tree734b9db43e07f72e02d100def352e5aa48d7dc46
parente5480f19a47abb914e0e61a8d9a8500f90caebe3 (diff)
downloadqpid-python-6056ab3b3de9dedf6765b79a643eb40f8d62ed90.tar.gz
fixed spurious delay in test
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@910821 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/python/qpid/tests/connection.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/qpid/python/qpid/tests/connection.py b/qpid/python/qpid/tests/connection.py
index 8c00df56e1..6847285f69 100644
--- a/qpid/python/qpid/tests/connection.py
+++ b/qpid/python/qpid/tests/connection.py
@@ -17,6 +17,7 @@
# under the License.
#
+import time
from threading import *
from unittest import TestCase
from qpid.util import connect, listen
@@ -183,8 +184,8 @@ class ConnectionTest(TestCase):
condition = Condition()
def listener(m): messages.append(m)
def exc_listener(e):
- exceptions.append(e)
condition.acquire()
+ exceptions.append(e)
condition.notify()
condition.release()
@@ -197,7 +198,11 @@ class ConnectionTest(TestCase):
ssn.message_transfer("abort")
condition.acquire()
- condition.wait(10)
+ start = time.time()
+ elapsed = 0
+ while not exceptions and elapsed < 10:
+ condition.wait(10 - elapsed)
+ elapsed = time.time() - start
condition.release()
for i in range(10):