You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2010/03/25 18:19:31 UTC

svn commit: r927509 - in /qpid/trunk/qpid: cpp/src/tests/cluster.mk cpp/src/tests/cluster_tests.py cpp/src/tests/run_long_cluster_tests python/qpid/brokertest.py

Author: aconway
Date: Thu Mar 25 17:19:31 2010
New Revision: 927509

URL: http://svn.apache.org/viewvc?rev=927509&view=rev
Log:
Re-eneable run_long_cluster_tests.

Reduced duration to 2 minutes per test.
Reduced load to avoid timeouts
 - Fewer concurrent clients on test_management.
 - Delay  in ErrorGenerator for test_failover.

Modified:
    qpid/trunk/qpid/cpp/src/tests/cluster.mk
    qpid/trunk/qpid/cpp/src/tests/cluster_tests.py
    qpid/trunk/qpid/cpp/src/tests/run_long_cluster_tests
    qpid/trunk/qpid/python/qpid/brokertest.py

Modified: qpid/trunk/qpid/cpp/src/tests/cluster.mk
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/cluster.mk?rev=927509&r1=927508&r2=927509&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/cluster.mk (original)
+++ qpid/trunk/qpid/cpp/src/tests/cluster.mk Thu Mar 25 17:19:31 2010
@@ -60,6 +60,7 @@ EXTRA_DIST +=					\
 	cluster_tests.fail
 
 LONG_TESTS +=					\
+	run_long_cluster_tests                  \
 	start_cluster				\
 	cluster_python_tests			\
 	stop_cluster

Modified: qpid/trunk/qpid/cpp/src/tests/cluster_tests.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/cluster_tests.py?rev=927509&r1=927508&r2=927509&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/cluster_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/cluster_tests.py Thu Mar 25 17:19:31 2010
@@ -230,46 +230,44 @@ class LongTests(BrokerTest):
         clients = [] # Ordinary clients that only connect to one broker.
         mclients = [] # Management clients that connect to every broker in the cluster.
 
-        def start_clients(broker):
-            """Start ordinary clients for a broker"""
-            batch = []
-            for cmd in [
+        def start_clients(broker, i):
+            """Start ordinary clients for a broker. Start one client per broker.
+            Round-robin on a colllection of different clients."""
+            cmds=[
                 ["perftest", "--count", 50000,
                  "--base-name", str(qpid.datatypes.uuid4()), "--port", broker.port()],
                 ["qpid-queue-stats", "-a", "localhost:%s" %(broker.port())],
-                ["testagent", "localhost", str(broker.port())] ]:
-                batch.append(ClientLoop(broker, cmd))
-            clients.append(batch)
+                ["testagent", "localhost", str(broker.port())] ]
+            clients.append([ClientLoop(broker, cmds[i%len(cmds)])])
 
         def start_mclients(broker):
-            """Start management clients that make multiple connections"""
-            for cmd in [
-                ["qpid-stat", "-b", "localhost:%s" %(broker.port())]
-                ]:
-                mclients.append(ClientLoop(broker, cmd))
+            """Start management clients that make multiple connections."""
+            cmd = ["qpid-stat", "-b", "localhost:%s" %(broker.port())]
+            mclients.append(ClientLoop(broker, cmd))
 
         endtime = time.time() + self.duration()
         alive = 0                       # First live cluster member
-        for b in cluster:
-            start_clients(b)
-            start_mclients(b)
+        for i in range(len(cluster)):
+            start_clients(cluster[i], i)
+        start_mclients(cluster[alive])
 
         while time.time() < endtime:
             time.sleep(min(5,self.duration()/2))
             for b in cluster[alive:]: b.ready() # Check if a broker crashed.
-            # Kill the first broker. Ignore errors on its clients and all the mclients
+            # Kill the first broker, expect the clients to fail. 
             for c in clients[alive] + mclients: c.expect_fail()
             b = cluster[alive]
             b.expect = EXPECT_EXIT_FAIL
             b.kill()
+            # Stop the brokers clients and all the mclients.
             for c in clients[alive] + mclients: c.stop()
             clients[alive] = []
             mclients = []
             # Start another broker and clients
             alive += 1
-            b = cluster.start()
-            start_clients(b)
-            for b in cluster[alive:]: start_mclients(b)
+            cluster.start()
+            start_clients(cluster[-1], len(cluster)-1)
+            start_mclients(cluster[alive])
         for c in chain(mclients, *clients):
             c.stop()
 

Modified: qpid/trunk/qpid/cpp/src/tests/run_long_cluster_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_long_cluster_tests?rev=927509&r1=927508&r2=927509&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_long_cluster_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_long_cluster_tests Thu Mar 25 17:19:31 2010
@@ -20,4 +20,5 @@
 #
 
 srcdir=`dirname $0`
-$srcdir/run_cluster_tests 'cluster_tests.LongTests.*' -DDURATION=5
+$srcdir/run_cluster_tests 'cluster_tests.LongTests.*' -DDURATION=2
+

Modified: qpid/trunk/qpid/python/qpid/brokertest.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/brokertest.py?rev=927509&r1=927508&r2=927509&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/brokertest.py (original)
+++ qpid/trunk/qpid/python/qpid/brokertest.py Thu Mar 25 17:19:31 2010
@@ -605,6 +605,7 @@ class ErrorGenerator(StoppableThread):
                         queue="non-existent-queue")
                     assert(False)
                 except qpid.session.SessionException: pass
+                time.sleep(0.01)
         except: pass                    # Normal if broker is killed.
 
 def import_script(path):



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