summaryrefslogtreecommitdiff
path: root/python
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
commitf94a5dff66eeeb002442f02e2dfd72eac0ea8b5c (patch)
tree2cafe58e6371b0d3a80bac0b34b470b6aac3691e /python
parentdb1ba895a227aa22fde7d95b88a22114d977e35a (diff)
downloadqpid-python-f94a5dff66eeeb002442f02e2dfd72eac0ea8b5c.tar.gz
fixed spurious delay in test
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@910821 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/tests/connection.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/qpid/tests/connection.py b/python/qpid/tests/connection.py
index 8c00df56e1..6847285f69 100644
--- a/python/qpid/tests/connection.py
+++ b/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):