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/06/23 22:56:31 UTC

svn commit: r957337 - in /qpid/trunk/qpid: cpp/src/qpid/broker/Connection.cpp cpp/src/tests/cluster_tests.py cpp/src/tests/run_cluster_tests python/qpid/brokertest.py

Author: aconway
Date: Wed Jun 23 20:56:30 2010
New Revision: 957337

URL: http://svn.apache.org/viewvc?rev=957337&view=rev
Log:
Make management+cluster test more aggressive.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
    qpid/trunk/qpid/cpp/src/tests/cluster_tests.py
    qpid/trunk/qpid/cpp/src/tests/run_cluster_tests
    qpid/trunk/qpid/python/qpid/brokertest.py

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp?rev=957337&r1=957336&r2=957337&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp Wed Jun 23 20:56:30 2010
@@ -71,7 +71,8 @@ struct ConnectionTimeoutTask : public sy
     void fire() {
         // If we get here then we've not received any traffic in the timeout period
         // Schedule closing the connection for the io thread
-        QPID_LOG(error, "Connection timed out: closing");
+        QPID_LOG(error, "Connection " << connection.getMgmtId()
+                 << " timed out: closing");
         connection.abort();
     }
 };

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=957337&r1=957336&r2=957337&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/cluster_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/cluster_tests.py Wed Jun 23 20:56:30 2010
@@ -260,34 +260,31 @@ class LongTests(BrokerTest):
         if BrokerTest.store_lib: args +=["--load-module", BrokerTest.store_lib]
         cluster = self.cluster(3, args)
         
-        clients = [] # Ordinary clients that only connect to one broker.
+        clients = [] # Per-broker list of clients that only connect to one broker.
         mclients = [] # Management clients that connect to every broker in the cluster.
 
-        def start_clients(broker, i):
-            """Start ordinary clients for a broker. Start one client per broker.
-            Round-robin on a colllection of different clients."""
+        def start_clients(broker):
+            """Start ordinary clients for a broker."""
             cmds=[
                 ["qpid-tool", "localhost:%s"%(broker.port())],
                 ["qpid-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())] ]
-            clients.append([ClientLoop(broker, cmds[i%len(cmds)])])
+            clients.append([ClientLoop(broker, cmd) for cmd in cmds])
 
         def start_mclients(broker):
             """Start management clients that make multiple connections."""
             cmd = ["qpid-stat", "-b", "localhost:%s" %(broker.port())]
             mclients.append(ClientLoop(broker, cmd))
 
-        duration = max(self.duration(), 5)
-        endtime = time.time() + duration
+        endtime = time.time() + self.duration()
         alive = 0                       # First live cluster member
-        for i in range(len(cluster)):
-            start_clients(cluster[i], i)
+        for i in range(len(cluster)): start_clients(cluster[i])
         start_mclients(cluster[alive])
 
         while time.time() < endtime:
-            time.sleep(min(5,duration/2))
+            time.sleep(max(5,self.duration()/4))
             for b in cluster[alive:]: b.ready() # Check if a broker crashed.
             # Kill the first broker, expect the clients to fail. 
             for c in clients[alive] + mclients: c.expect_fail()
@@ -301,7 +298,7 @@ class LongTests(BrokerTest):
             # Start another broker and clients
             alive += 1
             cluster.start()
-            start_clients(cluster[-1], len(cluster)-1)
+            start_clients(cluster[-1])
             start_mclients(cluster[alive])
         for c in chain(mclients, *clients):
             c.stop()

Modified: qpid/trunk/qpid/cpp/src/tests/run_cluster_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_cluster_tests?rev=957337&r1=957336&r2=957337&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_cluster_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_cluster_tests Wed Jun 23 20:56:30 2010
@@ -25,7 +25,7 @@ source $srcdir/ais_check
 test -x  $QPID_PYTHON_TEST || { echo Skipping test, $QPID_PYTHON_TEST not found; exit 0; }
 
 # Delete old cluster test data
-OUTDIR=brokertest.tmp
+OUTDIR=${OUTDIR:-brokertest.tmp}
 rm -rf $OUTDIR
 mkdir -p $OUTDIR
 

Modified: qpid/trunk/qpid/python/qpid/brokertest.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/brokertest.py?rev=957337&r1=957336&r2=957337&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/brokertest.py (original)
+++ qpid/trunk/qpid/python/qpid/brokertest.py Wed Jun 23 20:56:30 2010
@@ -240,10 +240,9 @@ class Popen(popen2.Popen3):
     def send_signal(self, sig):
         try: os.kill(self.pid,sig)
         except OSError,e: raise OSError("Kill failed %s: %s"%(self.pname, e))
-        self._cleanup()
 
-    def terminate(self): self.send_signal(signal.SIGTERM)
-    def kill(self): self.send_signal(signal.SIGKILL)
+    def terminate(self): self.send_signal(signal.SIGTERM); self._cleanup()
+    def kill(self): self.send_signal(signal.SIGKILL); self._cleanup()
 
     def cmd_str(self): return " ".join([str(s) for s in self.cmd])
 



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