qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r941852 - in /qpid/trunk/qpid: cpp/src/qpid/cluster/Cluster.cpp cpp/src/tests/Makefile.am python/qpid/brokertest.py
Date Thu, 06 May 2010 18:53:29 GMT
Author: aconway
Date: Thu May  6 18:53:29 2010
New Revision: 941852

URL: http://svn.apache.org/viewvc?rev=941852&view=rev
Log:
Correct brokertest.retry logic.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    qpid/trunk/qpid/cpp/src/tests/Makefile.am
    qpid/trunk/qpid/python/qpid/brokertest.py

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=941852&r1=941851&r2=941852&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Thu May  6 18:53:29 2010
@@ -965,7 +965,7 @@ void Cluster::memberUpdate(Lock& l) {
         // Mark store clean if I am the only broker, dirty otherwise.
         if (size == 1 ) {
             if (store.getState() != STORE_STATE_CLEAN_STORE) {
-                QPID_LOG(notice, "Sole member of cluster, marking store clean.");
+                QPID_LOG(notice, *this << "Sole member of cluster, marking store clean.");
                 store.clean(Uuid(true));
             }
         }

Modified: qpid/trunk/qpid/cpp/src/tests/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/Makefile.am?rev=941852&r1=941851&r2=941852&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/Makefile.am (original)
+++ qpid/trunk/qpid/cpp/src/tests/Makefile.am Thu May  6 18:53:29 2010
@@ -370,7 +370,7 @@ EXTRA_DIST+=						\
 check-long:
 	$(MAKE) check TESTS="$(LONG_TESTS)" VALGRIND=
 
-check: python_prep
+check: python_prep test_env.sh
 
 PYTHON_SRC_DIR=$(abs_srcdir)/../../../python
 PYTHON_BLD_DIR=$(abs_builddir)/python

Modified: qpid/trunk/qpid/python/qpid/brokertest.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/brokertest.py?rev=941852&r1=941851&r2=941852&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/brokertest.py (original)
+++ qpid/trunk/qpid/python/qpid/brokertest.py Thu May  6 18:53:29 2010
@@ -94,12 +94,12 @@ def retry(function, timeout=5, delay=.01
     """Call function until it returns True or timeout expires.
     Double the delay for each retry. Return True if function
     returns true, False if timeout expires."""
-    elapsed = 0
     while not function():
-        elapsed += delay
-        if elapsed > timeout: return False
-        delay *= 2
+        if delay > timeout: delay = timeout
         time.sleep(delay)
+        timeout -= delay
+        if timeout <= 0: return False
+        delay *= 2
     return True
 
 class Popen(popen2.Popen3):



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


Mime
View raw message