qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r910821 - /qpid/trunk/qpid/python/qpid/tests/connection.py
Date Wed, 17 Feb 2010 04:54:04 GMT
Author: rhs
Date: Wed Feb 17 04:54:03 2010
New Revision: 910821

URL: http://svn.apache.org/viewvc?rev=910821&view=rev
Log:
fixed spurious delay in test

Modified:
    qpid/trunk/qpid/python/qpid/tests/connection.py

Modified: qpid/trunk/qpid/python/qpid/tests/connection.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/tests/connection.py?rev=910821&r1=910820&r2=910821&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/tests/connection.py (original)
+++ qpid/trunk/qpid/python/qpid/tests/connection.py Wed Feb 17 04:54:03 2010
@@ -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 @@
     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 @@
     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):



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message