You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by sm...@apache.org on 2014/07/11 06:17:51 UTC

[11/50] [abbrv] git commit: SLIDER-207 TestClusterConnectivity fails on Jenkins

SLIDER-207 TestClusterConnectivity fails on Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/0f9344bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/0f9344bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/0f9344bd

Branch: refs/heads/master
Commit: 0f9344bdae038174f0faf6a34cc1686dad0f3840
Parents: 4933cd8
Author: Steve Loughran <st...@apache.org>
Authored: Thu Jul 3 09:28:08 2014 +0100
Committer: Steve Loughran <st...@apache.org>
Committed: Thu Jul 3 09:28:08 2014 +0100

----------------------------------------------------------------------
 .../basic/TestClusterConnectivity.groovy        | 33 ++++++++++++++------
 1 file changed, 23 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/0f9344bd/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy
index 8436dc9..b9d768a 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/basic/TestClusterConnectivity.groovy
@@ -26,17 +26,32 @@ import org.apache.slider.client.SliderYarnClientImpl
 import org.apache.slider.common.SliderXmlConfKeys
 import org.apache.slider.core.zk.ZookeeperUtils
 import org.apache.slider.funtest.framework.CommandTestBase
+import org.junit.BeforeClass
 import org.junit.Test
 
 @Slf4j
+/**
+ * Test basic connectivity with the target cluster, including 
+ * HDFS, YARN and ZK
+ */
 class TestClusterConnectivity extends CommandTestBase {
 
+
+  public static final int CONNECT_TIMEOUT = 2000
+
+  @BeforeClass
+  public static void setup() {
+    assumeFunctionalTestsEnabled()
+  }
+  
   @Test
   public void testFileSystemUp() throws Throwable {
 
     def fs = clusterFS
     def status = fs.listStatus(new Path("/"))
-    status.each {it -> log.info("${it.path} = ${it}")}
+    status.each {
+      log.info("${it.path} = ${it}")
+    }
     
   }
 
@@ -45,7 +60,9 @@ class TestClusterConnectivity extends CommandTestBase {
     def quorum = SLIDER_CONFIG.getTrimmed(SliderXmlConfKeys.REGISTRY_ZK_QUORUM)
     assert quorum
     def tuples = ZookeeperUtils.splitToHostsAndPortsStrictly(quorum);
-    tuples.each {it -> telnet(it.getHostText(), it.getPort())}
+    tuples.each {
+      telnet(it.hostText, it.port)
+    }
     
   }
 
@@ -79,18 +96,14 @@ class TestClusterConnectivity extends CommandTestBase {
     assert host != ""
     assert port != 0
     try {
-      def socket = new Socket(host, port);
+      def socket = new Socket();
+      def addr = new InetSocketAddress(host, port)
+      socket.connect(addr, CONNECT_TIMEOUT)
+      socket.close()
     } catch (IOException e) {
       throw NetUtils.wrapException(host, port, "localhost", 0, e)
     }
-/*
 
-    socket.withStreams { input, output ->
-      output << "echo testing ...\n"
-      def buffer = input.newReader().readLine()
-      println "response = ${buffer}"
-*/
-    
   }
   
 }