You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2014/05/20 16:39:54 UTC

svn commit: r1596269 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java

Author: kwall
Date: Tue May 20 14:39:53 2014
New Revision: 1596269

URL: http://svn.apache.org/r1596269
Log:
NO-JIRA: [Java Broker] Add extra assertions to PortRestTest to help investigate sporadic test failure on some CI environments

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java?rev=1596269&r1=1596268&r2=1596269&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java Tue May 20 14:39:53 2014
@@ -123,7 +123,8 @@ public class PortRestTest extends QpidRe
         String portNameJMX = "test-port-jmx";
         attributes = new HashMap<String, Object>();
         attributes.put(Port.NAME, portNameJMX);
-        attributes.put(Port.PORT, getNextAvailable(rmiPort + 1));
+        int jmxPort = getNextAvailable(rmiPort + 1);
+        attributes.put(Port.PORT, jmxPort);
         attributes.put(Port.PROTOCOLS, Collections.singleton(Protocol.JMX_RMI));
         attributes.put(JmxPort.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
 
@@ -144,9 +145,17 @@ public class PortRestTest extends QpidRe
         assertEquals("Unexpected response code", 201, responseCode);
 
 
-
         // make sure that port is there after broker restart
-        restartBroker();
+        stopBroker();
+
+        // Temporary code to investigate sporadic test failure.
+        boolean rmiIsFree = getNextAvailable(rmiPort) == rmiPort;
+        boolean jmxIsFree = getNextAvailable(jmxPort) == jmxPort;
+
+        assertTrue("Expecting rmiPort to be free after broker stop", rmiIsFree);
+        assertTrue("Expecting jmxPort to be free after broker stop", jmxIsFree);
+
+        startBroker();
 
         portDetails = getRestTestHelper().getJsonAsList("port/" + portNameRMI);
         assertNotNull("Port details cannot be null", portDetails);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org