diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2010-02-17 04:54:03 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2010-02-17 04:54:03 +0000 |
| commit | 56ba9d708dc94bee25553107f6e326f6700ec93a (patch) | |
| tree | 2cafe58e6371b0d3a80bac0b34b470b6aac3691e /python | |
| parent | c8aababc305d48344b5705bd125f8692153e6815 (diff) | |
| download | qpid-python-56ba9d708dc94bee25553107f6e326f6700ec93a.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.py | 9 |
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): |
