hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1604333 - /hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPTaskFaults.java
Date Sat, 21 Jun 2014 10:31:44 GMT
Author: edwardyoon
Date: Sat Jun 21 10:31:44 2014
New Revision: 1604333

URL: http://svn.apache.org/r1604333
Log:
catch and ignore meaningless BindException

Modified:
    hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPTaskFaults.java

Modified: hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPTaskFaults.java
URL: http://svn.apache.org/viewvc/hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPTaskFaults.java?rev=1604333&r1=1604332&r2=1604333&view=diff
==============================================================================
--- hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPTaskFaults.java (original)
+++ hama/trunk/core/src/test/java/org/apache/hama/bsp/TestBSPTaskFaults.java Sat Jun 21 10:31:44
2014
@@ -24,6 +24,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.net.BindException;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.List;
@@ -414,7 +415,6 @@ public class TestBSPTaskFaults extends T
 
   @Override
   protected void setUp() throws Exception {
-
     super.setUp();
     conf = new HamaConfiguration();
 
@@ -423,22 +423,25 @@ public class TestBSPTaskFaults extends T
     conf.setClass(SyncServiceFactory.SYNC_PEER_CLASS,
         LocalBSPRunner.LocalSyncClient.class, SyncClient.class);
 
-    int testNumber = incrementTestNumber();
-    InetSocketAddress inetAddress = new InetSocketAddress(
-        BSPNetUtils.getFreePort(34321) + testNumber);
-    groom = new MinimalGroomServer(conf);
-    workerServer = RPC.getServer(groom, inetAddress.getHostName(),
-        inetAddress.getPort(), conf);
-    workerServer.start();
-
-    LOG.info("Started RPC server");
-    conf.setInt("bsp.groom.rpc.port", inetAddress.getPort());
-
-    umbilical = (BSPPeerProtocol) RPC.getProxy(BSPPeerProtocol.class,
-        HamaRPCProtocolVersion.versionID, inetAddress, conf);
-    LOG.info("Started the proxy connections");
-
-    this.testBSPTaskService = Executors.newScheduledThreadPool(1);
+    int port = BSPNetUtils.getFreePort(34321 + incrementTestNumber());
+    try {
+      InetSocketAddress inetAddress = new InetSocketAddress(port);
+      groom = new MinimalGroomServer(conf);
+      workerServer = RPC.getServer(groom, inetAddress.getHostName(),
+          inetAddress.getPort(), conf);
+      workerServer.start();
+
+      LOG.info("Started RPC server");
+      conf.setInt("bsp.groom.rpc.port", inetAddress.getPort());
+
+      umbilical = (BSPPeerProtocol) RPC.getProxy(BSPPeerProtocol.class,
+          HamaRPCProtocolVersion.versionID, inetAddress, conf);
+      LOG.info("Started the proxy connections");
+
+      this.testBSPTaskService = Executors.newScheduledThreadPool(1);
+    } catch (BindException be) {
+      LOG.info(be);
+    }
   }
 
   private int getExpectedPingCounts() {



Mime
View raw message