qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1724856 - in /qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb: BDBHAVirtualHostNodeTest.java replication/ReplicatedEnvironmentFacadeTest.java
Date Fri, 15 Jan 2016 16:49:04 GMT
Author: kwall
Date: Fri Jan 15 16:49:04 2016
New Revision: 1724856

URL: http://svn.apache.org/viewvc?rev=1724856&view=rev
Log:
NO-JIRA: [BDB HA System Tests] Ensure test binds the same interface as BDB, increase timeout
so test is more reliable on a machine with fewer cores

Modified:
    qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeTest.java
    qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeTest.java

Modified: qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeTest.java?rev=1724856&r1=1724855&r2=1724856&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeTest.java
(original)
+++ qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeTest.java
Fri Jan 15 16:49:04 2016
@@ -780,12 +780,10 @@ public class BDBHAVirtualHostNodeTest ex
 
     public void testValidateOnCreateForAlreadyBoundAddress() throws Exception
     {
-        ServerSocket serverSocket = null;
-        try
+        try(ServerSocket serverSocket = new ServerSocket())
         {
-            serverSocket = new ServerSocket();
             serverSocket.setReuseAddress(true);
-            serverSocket.bind(new InetSocketAddress(0));
+            serverSocket.bind(new InetSocketAddress("localhost", 0));
             int node1PortNumber = serverSocket.getLocalPort();
 
             Map<String, Object> attributes = _helper.createNodeAttributes("node1",
"group", "localhost:" + node1PortNumber,
@@ -801,13 +799,6 @@ public class BDBHAVirtualHostNodeTest ex
                         String.format("Cannot bind to address '%s'. Address is already in
use.", "localhost:" + node1PortNumber), e.getMessage());
             }
         }
-        finally
-        {
-            if (serverSocket != null)
-            {
-                serverSocket.close();
-            }
-        }
     }
 
     public void testValidateOnCreateForInvalidStorePath() throws Exception

Modified: qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeTest.java?rev=1724856&r1=1724855&r2=1724856&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeTest.java
(original)
+++ qpid/java/trunk/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeTest.java
Fri Jan 15 16:49:04 2016
@@ -1012,7 +1012,7 @@ public class ReplicatedEnvironmentFacade
         ReplicatedEnvironmentFacade replica1 = createReplica(TEST_NODE_NAME + "_1", node1NodeHostPort,
new NoopReplicationGroupListener());
         replica1.close();
 
-        assertTrue("Majority lost is undetected", majorityLost.await(2, TimeUnit.SECONDS));
+        assertTrue("Majority lost is undetected", majorityLost.await(10, TimeUnit.SECONDS));
         assertEquals("Unexpected facade state", ReplicatedEnvironmentFacade.State.RESTARTING,
master.getFacadeState());
         assertEquals("Master node should not be recovered", 1, recoveredLatch.getCount());
         master.setDesignatedPrimary(true);



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


Mime
View raw message