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/06/18 08:37:35 UTC

git commit: SLIDER-144. Functional test fails with [Permission denied] on cluster - additional test fixes

Repository: incubator-slider
Updated Branches:
  refs/heads/develop 1bbeebedb -> 7003c06eb


SLIDER-144. Functional test fails with [Permission denied] on cluster - additional test fixes


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

Branch: refs/heads/develop
Commit: 7003c06eb4b6f372a99b84695f127d3410635ab9
Parents: 1bbeebe
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Tue Jun 17 23:34:54 2014 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Tue Jun 17 23:34:54 2014 -0700

----------------------------------------------------------------------
 slider-funtest/pom.xml                          |  4 ----
 .../funtest/framework/CommandTestBase.groovy    |  1 -
 .../funtest/framework/FuntestProperties.groovy  |  5 -----
 .../lifecycle/AgentCommandTestBase.groovy       | 19 +++++++++++++++++
 .../lifecycle/TestAgentClusterLifecycle.groovy  |  8 +++----
 .../lifecycle/TestAppsThroughAgent.groovy       | 22 ++------------------
 6 files changed, 24 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7003c06e/slider-funtest/pom.xml
----------------------------------------------------------------------
diff --git a/slider-funtest/pom.xml b/slider-funtest/pom.xml
index a2231d5..e56b19d 100644
--- a/slider-funtest/pom.xml
+++ b/slider-funtest/pom.xml
@@ -27,9 +27,6 @@
     <artifactId>slider</artifactId>
     <version>0.31.0-incubating-SNAPSHOT</version>
   </parent>
-  <properties>
-    <slider.disable.cleanup>false</slider.disable.cleanup>
-  </properties>
 
   <build>
 
@@ -115,7 +112,6 @@
             <java.security.krb5.kdc>${slider.test.java.security.krb5.kdc}</java.security.krb5.kdc>
             <!-- this property must be supplied-->
             <slider.conf.dir>${slider.conf.dir}</slider.conf.dir>
-            <slider.disable.cleanup>${slider.disable.cleanup}</slider.disable.cleanup>
             <slider.bin.dir>../slider-assembly/target/slider-${project.version}-all/slider-${project.version}</slider.bin.dir>
           </systemPropertyVariables>
           <includes>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7003c06e/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
index b95972a..d2accbb 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy
@@ -51,7 +51,6 @@ abstract class CommandTestBase extends SliderTestUtils {
 
   public static final String SLIDER_CONF_DIR = sysprop(SLIDER_CONF_DIR_PROP)
   public static final String SLIDER_BIN_DIR = sysprop(SLIDER_BIN_DIR_PROP)
-  public static final String DISABLE_CLEAN_UP = sysprop(DISABLE_CLEAN_UP_PROP)
   public static final File SLIDER_BIN_DIRECTORY = new File(
       SLIDER_BIN_DIR).canonicalFile
   public static final File SLIDER_SCRIPT = new File(

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7003c06e/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
index a6772b4..8cbc098 100644
--- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
+++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FuntestProperties.groovy
@@ -37,11 +37,6 @@ public interface FuntestProperties extends SliderXMLConfKeysForTesting {
    */
   String SLIDER_BIN_DIR_PROP = "slider.bin.dir"
 
-  /**
-   * Maven Property to disable test cleanup
-   */
-  String DISABLE_CLEAN_UP_PROP = "slider.disable.cleanup"
-
   String KEY_SLIDER_TEST_NUM_WORKERS = "slider.test.cluster.size"
   int DEFAULT_SLIDER_NUM_WORKERS = 1
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7003c06e/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
index 56cc4be..d5a91f0 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
@@ -161,6 +161,25 @@ class AgentCommandTestBase extends CommandTestBase
     return exists
   }
 
+  protected static void ensureApplicationIsUp(String clusterName, int maxAttemptCount = 15) {
+    SliderShell shell
+    int attemptCount = 0
+    while (attemptCount < maxAttemptCount) {
+      shell = slider(EXIT_SUCCESS, [
+          ACTION_LIST,
+          clusterName])
+
+      if (isAppRunning("RUNNING", shell)) {
+        break
+      }
+
+      attemptCount++
+      assert attemptCount != maxAttemptCount, 'Application did not start, aborting test.'
+
+      sleep(1000 * 3)
+    }
+  }
+
   public static void addDir(File dirObj, ZipOutputStream zipFile, String prefix) {
     dirObj.eachFile() { file ->
       if (file.directory) {

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7003c06e/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
index 0ac164f..3d0b270 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
@@ -51,11 +51,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
   @After
   public void destroyCluster() {
-    if (DISABLE_CLEAN_UP == null || !DISABLE_CLEAN_UP.equals("true")) {
-      teardown(CLUSTER)
-    } else {
-      log.info "Disabling cleanup for debugging purposes."
-    }
+    teardown(CLUSTER)
   }
 
   @Test
@@ -77,6 +73,8 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
     logShell(shell)
 
+    ensureApplicationIsUp(CLUSTER)
+
     //at this point the cluster should exist.
     assertPathExists(clusterFS, "Cluster parent directory does not exist", clusterpath.parent)
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7003c06e/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
index ed88f20..aef9aa1 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
@@ -38,11 +38,7 @@ public class TestAppsThroughAgent extends AgentCommandTestBase
 
   @After
   public void destroyCluster() {
-    if (DISABLE_CLEAN_UP == null || !DISABLE_CLEAN_UP.equals("true")) {
-      cleanup()
-    } else {
-      log.info "Disabling cleanup for debugging purposes."
-    }
+    cleanup()
   }
 
   @Test
@@ -64,21 +60,7 @@ public class TestAppsThroughAgent extends AgentCommandTestBase
 
       logShell(shell)
 
-      int attemptCount = 0
-      while (attemptCount < 10) {
-        shell = slider(EXIT_SUCCESS, [
-            ACTION_LIST,
-            APPLICATION_NAME])
-
-        if (isAppRunning("RUNNING", shell)) {
-          break
-        }
-
-        attemptCount++
-        assert attemptCount != 10, 'Application did not start, aborting test.'
-
-        sleep(1000 * 5)
-      }
+      ensureApplicationIsUp(APPLICATION_NAME)
 
       //flex
       slider(EXIT_SUCCESS,