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

[01/24] incubator-slider git commit: pre-SLIDER-622: move declaration of powermock and jettison versions to root POM

Repository: incubator-slider
Updated Branches:
  refs/heads/develop 62cdd6955 -> fc140b522


pre-SLIDER-622: move declaration of powermock and jettison versions to root POM


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

Branch: refs/heads/develop
Commit: 3a08b9fc5b8e65690ac75828bcee19d2319e8621
Parents: 62cdd69
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 16:30:14 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 16:30:14 2014 +0000

----------------------------------------------------------------------
 pom.xml             | 30 ++++++++++++++++++++++++++++++
 slider-core/pom.xml |  5 -----
 2 files changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3a08b9fc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4fdd7cd..1dc056b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1268,6 +1268,36 @@
       </dependency>
 
     </dependencies>
+    <dependency>
+      <groupId>org.codehaus.jettison</groupId>
+      <artifactId>jettison</artifactId>
+      <version>1.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-core</artifactId>
+      <version>1.5</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-reflect</artifactId>
+      <version>1.5</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-api-easymock</artifactId>
+      <version>1.5</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-module-junit4</artifactId>
+      <version>1.5</version>
+    </dependency>
+    
   </dependencyManagement>
 
   <profiles>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3a08b9fc/slider-core/pom.xml
----------------------------------------------------------------------
diff --git a/slider-core/pom.xml b/slider-core/pom.xml
index 77b9273..e6bc513 100644
--- a/slider-core/pom.xml
+++ b/slider-core/pom.xml
@@ -452,34 +452,29 @@
     <dependency>
       <groupId>org.codehaus.jettison</groupId>
       <artifactId>jettison</artifactId>
-      <version>1.1</version>
     </dependency>
 
     <dependency>
       <groupId>org.powermock</groupId>
       <artifactId>powermock-core</artifactId>
-      <version>1.5</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
       <groupId>org.powermock</groupId>
       <artifactId>powermock-reflect</artifactId>
-      <version>1.5</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
       <groupId>org.powermock</groupId>
       <artifactId>powermock-api-easymock</artifactId>
-      <version>1.5</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
       <groupId>org.powermock</groupId>
       <artifactId>powermock-module-junit4</artifactId>
-      <version>1.5</version>
       <scope>test</scope>
     </dependency>
 


[22/24] incubator-slider git commit: SLIDER-622 try and make TestStandaloneAgentAM more resilient to delayed-deletion

Posted by st...@apache.org.
SLIDER-622 try and make TestStandaloneAgentAM more resilient to delayed-deletion


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

Branch: refs/heads/develop
Commit: d148f5e9a24263a8bc27fbe9488c1618cbae677a
Parents: b8f3aa9
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 22:40:33 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 22:40:33 2014 +0000

----------------------------------------------------------------------
 .../apache/slider/agent/standalone/TestStandaloneAgentAM.groovy   | 1 +
 .../groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy  | 3 +++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/d148f5e9/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy
index 7987661..93547f1 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAgentAM.groovy
@@ -127,6 +127,7 @@ class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
     assert oldInstance != null
     assert oldInstance.yarnApplicationState >= YarnApplicationState.FINISHED
 
+    sleep(5000)
     //create another AM
     launcher = createStandaloneAM(clustername, true, true)
     client = launcher.service

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/d148f5e9/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
index 78b5fb9..dcc55f6 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
@@ -516,6 +516,9 @@ public abstract class YarnMiniClusterTestBase extends ServiceLauncherBaseTest {
       //this is a safety check to stop us doing something stupid like deleting /
       assert clusterDir.toString().contains("/.slider/")
       dfs.delete(clusterDir, true)
+      sleep(1000)
+      dfs.delete(clusterDir, true)
+      assert !dfs.exists(clusterDir), "delete operation failed —application in use?"
     }
 
 


[21/24] incubator-slider git commit: SLIDER-208 with too many zk dirs the scan for a test-classes in the (limited) stdout buffer fails

Posted by st...@apache.org.
SLIDER-208 with too many zk dirs the scan for a test-classes in the (limited) stdout buffer fails


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

Branch: refs/heads/develop
Commit: b8f3aa9e14eed54fb5fa2453681c2d40d4f58987
Parents: eaf77ba
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 22:39:45 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 22:39:45 2014 +0000

----------------------------------------------------------------------
 .../server/services/workflow/TestWorkflowForkedProcessService.java | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b8f3aa9e/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
index 01d5ec9..bc1476a 100644
--- a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
+++ b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
@@ -72,8 +72,6 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
     Integer exitCode = process.getExitCode();
     assertNotNull("null exit code", exitCode);
     assertEquals(0, exitCode.intValue());
-
-    assertStringInOutput("test-classes", getFinalOutput());
     // assert that the service did not fail
     assertNull(process.getFailureCause());
   }


[11/24] incubator-slider git commit: SLIDER-622 trying to automate adding path

Posted by st...@apache.org.
SLIDER-622 trying to automate adding path


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

Branch: refs/heads/develop
Commit: a8e17ab469101ef8bc05e85a9aee52103e8b516b
Parents: 9cc24d0
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 20:12:48 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 20:12:48 2014 +0000

----------------------------------------------------------------------
 pom.xml                                              |  6 ++++++
 slider-core/pom.xml                                  |  3 +++
 .../slider/common/tools/TestWindowsSupport.groovy    | 15 +++++++++++++++
 3 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a8e17ab4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2001e4e..33fc1ec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -131,6 +131,8 @@
     <test.failIfNoTests>true</test.failIfNoTests>
     <test.funtests.failIfNoTests>false</test.funtests.failIfNoTests>
     <test.forkMode>always</test.forkMode>
+    <!-- path environment variable -->
+    <test.env.path>${env.PATH}</test.env.path>    
     
     <!--
     core artifacts
@@ -1316,6 +1318,7 @@
         <module>app-packages/storm</module>
       </modules>
     </profile>
+    
     <profile>
       <id>Windows</id>
       <activation>
@@ -1323,6 +1326,9 @@
           <family>windows</family>
         </os>
       </activation>
+      <properties>
+        <test.env.path>${env.PATH}:{$project.basedir}\bin\windows\${hadoop.version}\bin}</test.env.path>  
+      </properties>
       <modules>
         <module>app-packages/hbase-win</module>
         <module>app-packages/storm-win</module>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a8e17ab4/slider-core/pom.xml
----------------------------------------------------------------------
diff --git a/slider-core/pom.xml b/slider-core/pom.xml
index e6bc513..2c3aaa6 100644
--- a/slider-core/pom.xml
+++ b/slider-core/pom.xml
@@ -116,6 +116,9 @@
           <argLine>${test.argLine}</argLine>
           <failIfNoTests>${test.failIfNoTests}</failIfNoTests>
           <redirectTestOutputToFile>${build.redirect.test.output.to.file}</redirectTestOutputToFile>
+          <environmentVariables>
+            <PATH>${test.env.path}</PATH>
+          </environmentVariables>
           <systemPropertyVariables>
             <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
             <java.awt.headless>true</java.awt.headless>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a8e17ab4/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
index 9b383f4..cbd79a4 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
@@ -169,4 +169,19 @@ class TestWindowsSupport extends YarnMiniClusterTestBase {
     exec(0, [winUtilsPath, "systeminfo"])
   }
 
+
+  @Test
+  public void testPath() throws Throwable {
+    String pathkey;
+    
+    System.getenv().keySet().each { String it ->
+      if (it.toLowerCase(Locale.ENGLISH).equals("path")) {
+        pathkey = it;
+      }
+    }
+    assert pathkey
+    log.info("Path env variable is $pathkey")
+    def pathval = System.getenv(pathkey)
+    log.info("Path value = $pathval")
+  }
 }


[04/24] incubator-slider git commit: SLIDER-622 tests sometimes converting exe failure to timeout - race condition in tests?

Posted by st...@apache.org.
SLIDER-622 tests sometimes converting exe failure to timeout - race condition in tests?


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

Branch: refs/heads/develop
Commit: fc7fa311400bf003baf625ececd83a3a13915265
Parents: b277c79
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 16:53:13 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 16:53:13 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/slider/common/tools/SliderUtils.java  | 10 ++++------
 .../server/services/utility/EndOfServiceWaiter.java       |  1 +
 .../apache/slider/common/tools/TestWindowsSupport.groovy  |  4 +---
 .../workflow/TestWorkflowForkedProcessService.java        |  4 +---
 4 files changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/fc7fa311/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java b/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
index db398a6..fa3f0bd 100644
--- a/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
+++ b/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
@@ -60,7 +60,6 @@ import org.apache.slider.core.exceptions.ErrorStrings;
 import org.apache.slider.core.exceptions.SliderException;
 import org.apache.slider.core.launch.ClasspathConstructor;
 import org.apache.slider.core.main.LauncherExitCodes;
-import org.apache.slider.server.services.utility.EndOfServiceWaiter;
 import org.apache.slider.server.services.utility.PatternValidator;
 import org.apache.slider.server.services.workflow.ForkedProcessService;
 import org.apache.zookeeper.server.util.KerberosUtil;
@@ -75,7 +74,6 @@ import java.io.FileReader;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.InterruptedIOException;
 import java.io.PrintWriter;
 import java.io.Serializable;
 import java.io.StringWriter;
@@ -1910,10 +1908,12 @@ public final class SliderUtils {
     process.setProcessLog(logger);
     process.init(new Configuration());
     String errorText = null;
-    EndOfServiceWaiter waiter = new EndOfServiceWaiter(process);
     process.start();
     try {
-      waiter.waitForServiceToStop(timeoutMillis);
+      if (process.waitForServiceToStop(timeoutMillis)) {
+        throw new TimeoutException(
+            "Process did not stop in " + timeoutMillis + "mS");
+      }
       int exitCode = process.getExitCode();
       List<String> recentOutput = process.getRecentOutput();
       if (status != exitCode) {
@@ -1939,8 +1939,6 @@ public final class SliderUtils {
         return process;
       }
 
-    } catch (InterruptedException e) {
-      throw new InterruptedIOException(e.toString());
     } catch (TimeoutException e) {
       errorText = e.toString();
     }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/fc7fa311/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java b/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java
index 4a57133..40ceab8 100644
--- a/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java
+++ b/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java
@@ -59,6 +59,7 @@ public class EndOfServiceWaiter implements ServiceStateChangeListener {
 
   public synchronized void waitForServiceToStop(long timeout) throws
       InterruptedException, TimeoutException {
+    service.waitForServiceToStop(timeout);
     if (!finished.get()) {
       wait(timeout);
       if (!finished.get()) {

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/fc7fa311/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
index 6351c14..d7f4121 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
@@ -27,7 +27,6 @@ import org.apache.hadoop.fs.Path
 import org.apache.hadoop.fs.FileSystem as HadoopFS
 import org.apache.hadoop.util.Shell
 import org.apache.slider.providers.agent.AgentUtils
-import org.apache.slider.server.services.utility.EndOfServiceWaiter
 import org.apache.slider.server.services.workflow.ForkedProcessService
 import org.apache.slider.test.SliderTestBase
 import org.junit.Test
@@ -174,9 +173,8 @@ class TestWindowsSupport extends SliderTestBase {
         [:],
         commands);
     process.init(new Configuration());
-    EndOfServiceWaiter waiter = new EndOfServiceWaiter(process);
     process.start();
-    waiter.waitForServiceToStop(10000);
+    process.waitForServiceToStop(10000);
     process
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/fc7fa311/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
index c8c576b..cf0afc1 100644
--- a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
+++ b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
@@ -20,7 +20,6 @@ package org.apache.slider.server.services.workflow;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.service.ServiceOperations;
-import org.apache.slider.server.services.utility.EndOfServiceWaiter;
 import org.apache.slider.test.SliderTestUtils;
 import org.junit.After;
 import org.junit.Before;
@@ -137,9 +136,8 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
 
   public void exec() throws InterruptedException, TimeoutException {
     assertNotNull(process);
-    EndOfServiceWaiter waiter = new EndOfServiceWaiter(process);
     process.start();
-    waiter.waitForServiceToStop(5000);
+    process.waitForServiceToStop(5000);
   }
 
 }


[19/24] incubator-slider git commit: SLIDER-622 : TestStandaloneYarnRegistryAM - fix ZK instance separation problems (windows doesn't to rmdir while cluster is in use)

Posted by st...@apache.org.
SLIDER-622 : TestStandaloneYarnRegistryAM - fix ZK instance separation problems (windows doesn't to rmdir while cluster is in use)


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

Branch: refs/heads/develop
Commit: 23c71f58780b2e9bdbe5da6afa7d636869354ca1
Parents: 942791e
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 21:58:22 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 21:58:22 2014 +0000

----------------------------------------------------------------------
 .../groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/23c71f58/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy
index d5d7ecf..f6b13a4 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/YarnZKMiniClusterTestBase.groovy
@@ -100,7 +100,7 @@ public abstract class YarnZKMiniClusterTestBase extends YarnMiniClusterTestBase
                                    int numLogDirs,
                                    boolean startZK,
                                    boolean startHDFS) {
-    createMicroZKCluster("-${name?:'zk'}", conf)
+    createMicroZKCluster("-${name?:methodName.methodName}", conf)
     conf.setBoolean(RegistryConstants.KEY_REGISTRY_ENABLED, true)
     conf.set(RegistryConstants.KEY_REGISTRY_ZK_QUORUM, ZKBinding)
     name = super.createMiniCluster(name, conf, noOfNodeManagers, numLocalDirs, numLogDirs,


[20/24] incubator-slider git commit: SLIDER-622 add a second destroy operation after a sleep, may handle directory-not-deleted problems

Posted by st...@apache.org.
SLIDER-622 add a second destroy operation after a sleep, may handle directory-not-deleted problems


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

Branch: refs/heads/develop
Commit: eaf77bab5aa356ef3e09df29649447e8fac3b16e
Parents: 23c71f5
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 22:06:45 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 22:06:45 2014 +0000

----------------------------------------------------------------------
 .../slider/agent/standalone/TestStandaloneAMDestroy.groovy       | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/eaf77bab/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy
index 6593a0e..4a94eb3 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMDestroy.groovy
@@ -115,6 +115,10 @@ class TestStandaloneAMDestroy extends AgentMiniClusterTestBase {
     
     int exitCode = sliderClient.actionDestroy(clustername);
     assert 0 == exitCode
+    sleep(1000)
+    // twice, not expecting an error the second time
+    exitCode = sliderClient.actionDestroy(clustername);
+    assert 0 == exitCode
 
     describe "post destroy checks"
     sliderFileSystem.verifyDirectoryNonexistent(instanceDir)


[05/24] incubator-slider git commit: SLIDER-622 test for failfast execution

Posted by st...@apache.org.
SLIDER-622 test for failfast execution


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

Branch: refs/heads/develop
Commit: 63148ffc4a7a35535cf81541a740b37914bca1ab
Parents: fc7fa31
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 16:55:18 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 16:55:18 2014 +0000

----------------------------------------------------------------------
 .../org/apache/slider/common/tools/TestWindowsSupport.groovy   | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/63148ffc/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
index d7f4121..51c73b2 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
@@ -117,6 +117,12 @@ class TestWindowsSupport extends SliderTestBase {
     exec(0, ["xargs", "--version"])
   }
 
+  @Test
+  public void testExecNonexistentBinary() throws Throwable {
+    assume(Shell.WINDOWS, "not windows")
+    exec(2, ["undefined-application", "--version"])
+  }
+
   
   @Test
   public void testEmitKillCommand() throws Throwable {


[09/24] incubator-slider git commit: SLIDER-622 fixed erroneous negation

Posted by st...@apache.org.
SLIDER-622 fixed erroneous negation


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

Branch: refs/heads/develop
Commit: 09ef9240d758a8d9edc9506b4a6d98935b648dcf
Parents: 290a5e8
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 17:50:28 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 17:50:28 2014 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/slider/common/tools/SliderUtils.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/09ef9240/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java b/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
index fa3f0bd..f4cea00 100644
--- a/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
+++ b/slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
@@ -1910,7 +1910,7 @@ public final class SliderUtils {
     String errorText = null;
     process.start();
     try {
-      if (process.waitForServiceToStop(timeoutMillis)) {
+      if (!process.waitForServiceToStop(timeoutMillis)) {
         throw new TimeoutException(
             "Process did not stop in " + timeoutMillis + "mS");
       }


[17/24] incubator-slider git commit: SLIDER-622 fix ZK instance separation problems (windows doesn't to rmdir while cluster is in use)

Posted by st...@apache.org.
SLIDER-622 fix ZK instance separation problems (windows doesn't to rmdir while cluster is in use)


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

Branch: refs/heads/develop
Commit: 022e9296b0f0cce05b82230739f98b4949505077
Parents: 03a670a
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 21:31:55 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 21:31:55 2014 +0000

----------------------------------------------------------------------
 .../org/apache/slider/common/tools/TestZKIntegration.groovy      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/022e9296/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy
index 1b7ea52..460dafb 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestZKIntegration.groovy
@@ -72,7 +72,7 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest
     assertHasZKCluster()
 
     ZKIntegration zki = createZKIntegrationInstance(
-        getZKBinding(), "", true, false, 5000)
+        getZKBinding(), methodName.methodName, true, false, 5000)
     String userPath = ZKIntegration.mkSliderUserPath(USER)
     String fullPath = zki.createPath(userPath, "/cluster-",
                                      ZooDefs.Ids.OPEN_ACL_UNSAFE,
@@ -86,7 +86,7 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest
   @Test
   public void testListUserClustersWithTwoCluster() throws Throwable {
     ZKIntegration zki = createZKIntegrationInstance(
-        getZKBinding(), "", true, false, 5000)
+        getZKBinding(), methodName.methodName, true, false, 5000)
     String userPath = ZKIntegration.mkSliderUserPath(USER)
     String c1 = createEphemeralChild(zki, userPath)
     log.info("Ephemeral path $c1")


[23/24] incubator-slider git commit: SLIDER-208 TestLongLivedProcess: with too many zk dirs the scan for a test-classes in the (limited) stdout buffer fails

Posted by st...@apache.org.
SLIDER-208 TestLongLivedProcess: with too many zk dirs the scan for a test-classes in the (limited) stdout buffer fails


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

Branch: refs/heads/develop
Commit: 81ada2395c20bc529d572c7bcc7bdee337c22019
Parents: d148f5e
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 22:42:51 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 22:42:51 2014 +0000

----------------------------------------------------------------------
 .../slider/server/services/workflow/TestLongLivedProcess.java      | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/81ada239/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java
index 545ba48..0eb2b78 100644
--- a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java
+++ b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestLongLivedProcess.java
@@ -70,8 +70,6 @@ public class TestLongLivedProcess extends WorkflowServiceTestBase implements
     assertTrue("process stop callback not received", stopped);
     assertFalse(process.isRunning());
     assertEquals(0, process.getExitCode().intValue());
-
-    assertStringInOutput("test-classes", getFinalOutput());
   }
 
   @Test


[02/24] incubator-slider git commit: SLIDER-544: track changing hadoop branch versions

Posted by st...@apache.org.
SLIDER-544: track changing hadoop branch versions


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

Branch: refs/heads/develop
Commit: 400d069e498a01d844dc62fb610e8931905ff75b
Parents: 3a08b9f
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 16:32:33 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 16:32:33 2014 +0000

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/400d069e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1dc056b..5b58597 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1414,7 +1414,7 @@
       <!-- hadoop branch-2 builds  -->
       <id>branch-2</id>
       <properties>
-        <hadoop.version>2.6.0-SNAPSHOT</hadoop.version>
+        <hadoop.version>2.7.0-SNAPSHOT</hadoop.version>
       </properties>
     </profile>
     


[07/24] incubator-slider git commit: SLIDER-622 test for failfast execution if file not found

Posted by st...@apache.org.
SLIDER-622 test for failfast execution if file not found


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

Branch: refs/heads/develop
Commit: 1ea195d2e222fa8ddc7669e2f03a472e51031c1a
Parents: efc9922
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 17:08:13 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 17:08:13 2014 +0000

----------------------------------------------------------------------
 .../apache/slider/common/tools/TestWindowsSupport.groovy  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1ea195d2/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
index 51c73b2..25b7c57 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
@@ -25,6 +25,7 @@ import org.apache.hadoop.fs.ChecksumFileSystem
 import org.apache.hadoop.fs.FSDataInputStream
 import org.apache.hadoop.fs.Path
 import org.apache.hadoop.fs.FileSystem as HadoopFS
+import org.apache.hadoop.service.ServiceStateException
 import org.apache.hadoop.util.Shell
 import org.apache.slider.providers.agent.AgentUtils
 import org.apache.slider.server.services.workflow.ForkedProcessService
@@ -120,10 +121,15 @@ class TestWindowsSupport extends SliderTestBase {
   @Test
   public void testExecNonexistentBinary() throws Throwable {
     assume(Shell.WINDOWS, "not windows")
-    exec(2, ["undefined-application", "--version"])
+    try {
+      exec(2, ["undefined-application", "--version"])
+    } catch (ServiceStateException e) {
+      if (!(e.cause instanceof FileNotFoundException)) {
+        throw e;
+      }
+    }
   }
 
-  
   @Test
   public void testEmitKillCommand() throws Throwable {
     killJavaProcesses("regionserver", 9)


[10/24] incubator-slider git commit: SLIDER-622 kill operation tested for at class load time; used to skip kill() operations.Tests that use the kill explicilty must then be made to skip if not kill_supported

Posted by st...@apache.org.
SLIDER-622 kill operation tested for at class load time; used to skip kill() operations.Tests that use the kill explicilty must then be made to skip if not kill_supported


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

Branch: refs/heads/develop
Commit: 9cc24d0080a1cf07ebd5970ed1d9b4e097660538
Parents: 09ef924
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 17:51:39 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 17:51:39 2014 +0000

----------------------------------------------------------------------
 .../standalone/TestStandaloneAMKill.groovy      |  4 +-
 .../common/tools/TestWindowsSupport.groovy      | 48 +++++-----------
 .../apache/slider/test/SliderTestUtils.groovy   | 38 -------------
 .../slider/test/YarnMiniClusterTestBase.groovy  | 60 +++++++++++++++++++-
 .../providers/accumulo/AccumuloTestBase.groovy  |  2 +-
 .../accumulo/live/TestAccFreezeThaw.groovy      |  4 +-
 6 files changed, 80 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9cc24d00/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMKill.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMKill.groovy b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMKill.groovy
index bad2715..d6b3929 100644
--- a/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMKill.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/agent/standalone/TestStandaloneAMKill.groovy
@@ -27,6 +27,7 @@ import org.apache.slider.client.SliderClient
 import org.apache.slider.common.SliderXmlConfKeys
 import org.apache.slider.common.params.Arguments
 import org.apache.slider.core.main.ServiceLauncher
+import org.junit.Assume
 import org.junit.Test
 
 /**
@@ -38,9 +39,9 @@ import org.junit.Test
 
 class TestStandaloneAMKill extends AgentMiniClusterTestBase {
 
-
   @Test
   public void testKillStandaloneAM() throws Throwable {
+    Assume.assumeTrue(kill_supported)
     String clustername = createMiniCluster("", configuration, 1, true)
 
     describe "kill a Standalone AM and verify that it shuts down"
@@ -54,6 +55,7 @@ class TestStandaloneAMKill extends AgentMiniClusterTestBase {
     SliderClient sliderClient = launcher.service
     addToTeardown(sliderClient);
     ApplicationReport report = waitForClusterLive(sliderClient)
+    assert report.yarnApplicationState == YarnApplicationState.RUNNING
 
     describe("listing Java processes")
     lsJavaProcesses();

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9cc24d00/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
index 25b7c57..9b383f4 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
@@ -28,15 +28,15 @@ import org.apache.hadoop.fs.FileSystem as HadoopFS
 import org.apache.hadoop.service.ServiceStateException
 import org.apache.hadoop.util.Shell
 import org.apache.slider.providers.agent.AgentUtils
-import org.apache.slider.server.services.workflow.ForkedProcessService
 import org.apache.slider.test.SliderTestBase
+import org.apache.slider.test.YarnMiniClusterTestBase
 import org.junit.Test
 
 import java.util.regex.Pattern
 
 @CompileStatic
 @Slf4j
-class TestWindowsSupport extends SliderTestBase {
+class TestWindowsSupport extends YarnMiniClusterTestBase {
 
   private static final Pattern hasDriveLetterSpecifier =
       Pattern.compile("^/?[a-zA-Z]:");
@@ -121,18 +121,28 @@ class TestWindowsSupport extends SliderTestBase {
   @Test
   public void testExecNonexistentBinary() throws Throwable {
     assume(Shell.WINDOWS, "not windows")
+    def commands = ["undefined-application", "--version"]
     try {
-      exec(2, ["undefined-application", "--version"])
+      exec(0, commands)
+      fail("expected an exception")
     } catch (ServiceStateException e) {
       if (!(e.cause instanceof FileNotFoundException)) {
         throw e;
       }
     }
   }
+  @Test
+  public void testExecNonexistentBinary2() throws Throwable {
+    assume(Shell.WINDOWS, "not windows")
+    assert !doesWindowsAppExist(["undefined-application", "--version"])
+  }
 
   @Test
   public void testEmitKillCommand() throws Throwable {
-    killJavaProcesses("regionserver", 9)
+
+    def result = killJavaProcesses("regionserver", 9)
+    // we know the exit code if there is no supported kill operation
+    assert kill_supported || result == -1
   }
 
   @Test
@@ -159,34 +169,4 @@ class TestWindowsSupport extends SliderTestBase {
     exec(0, [winUtilsPath, "systeminfo"])
   }
 
-
-  /**
-   * Exec a set of commands, wait a few seconds for it to finish.
-   * @param status code
-   * @param commands
-   * @return the process
-   */
-  public ForkedProcessService exec(int status, List<String> commands) {
-    ForkedProcessService process = exec(commands)
-    assert status == process.exitCode
-    return process
-  }
-  
-  /**
-     * Exec a set of commands, wait a few seconds for it to finish.
-     * @param commands
-     * @return
-     */
-  
-  public ForkedProcessService exec(List<String> commands) {
-    ForkedProcessService process;
-    process = new ForkedProcessService(
-        methodName.methodName,
-        [:],
-        commands);
-    process.init(new Configuration());
-    process.start();
-    process.waitForServiceToStop(10000);
-    process
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9cc24d00/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
index 8d6c036..ad18c72 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
@@ -925,44 +925,6 @@ class SliderTestUtils extends Assert {
   }
 
   /**
-   * Kill any java process with the given grep pattern
-   * @param grepString string to grep for
-   */
-  public int killJavaProcesses(String grepString, int signal) {
-
-    def commandString
-    if (!Shell.WINDOWS) {
-      GString killCommand = "jps -l| grep ${grepString} | awk '{print \$1}' | xargs kill $signal"
-      log.info("Command command = $killCommand")
-
-      commandString = ["bash", "-c", killCommand]
-    } else {
-      /*
-      "jps -l | grep "String" | awk "{print $1}" | xargs -n 1 taskkill /PID"
-       */
-      GString killCommand = "\"jps -l | grep \"${grepString}\" | gawk \"{print \$1}\" | xargs -n 1 taskkill /f /PID\""
-      commandString = ["CMD", "/C", killCommand]
-    }
-    Process command = commandString.execute()
-    def exitCode = command.waitFor()
-
-    log.info(command.in.text)
-    log.error(command.err.text)
-    return exitCode
-  }
-
-  /**
-   * Kill all processes which match one of the list of grepstrings
-   * @param greps
-   * @param signal
-   */
-  public void killJavaProcesses(List<String> greps, int signal) {
-    for (String grep : greps) {
-      killJavaProcesses(grep, signal)
-    }
-  }
-
-  /**
    * Convert a file to a URI suitable for use in an argument
    * @param file file
    * @return a URI string valid on all platforms

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9cc24d00/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
index eb7cfa2..d5bad50 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
@@ -29,6 +29,7 @@ import org.apache.hadoop.fs.Path
 import org.apache.hadoop.hdfs.DFSConfigKeys
 import org.apache.hadoop.hdfs.MiniDFSCluster
 import org.apache.hadoop.service.ServiceOperations
+import org.apache.hadoop.util.Shell
 import org.apache.hadoop.yarn.api.records.ApplicationReport
 import org.apache.hadoop.yarn.api.records.YarnApplicationState
 import org.apache.hadoop.yarn.conf.YarnConfiguration
@@ -84,6 +85,9 @@ public abstract class YarnMiniClusterTestBase extends ServiceLauncherBaseTest {
 
 
   public static final YarnConfiguration SLIDER_CONFIG = SliderUtils.createConfiguration();
+  
+  public static boolean kill_supported;
+  
   static {
     SLIDER_CONFIG.setInt(SliderXmlConfKeys.KEY_AM_RESTART_LIMIT, 1)
     SLIDER_CONFIG.setInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS, 100)
@@ -92,7 +96,6 @@ public abstract class YarnMiniClusterTestBase extends ServiceLauncherBaseTest {
     SLIDER_CONFIG.setBoolean(SliderXmlConfKeys.KEY_SLIDER_AM_DEPENDENCY_CHECKS_DISABLED,
         true)
     SLIDER_CONFIG.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 1)
-    
   }
 
 
@@ -195,6 +198,7 @@ public abstract class YarnMiniClusterTestBase extends ServiceLauncherBaseTest {
   protected void addToTeardown(SliderClient client) {
     clustersToTeardown << client;
   }
+
   protected void addToTeardown(ServiceLauncher<SliderClient> launcher) {
     SliderClient sliderClient = launcher?.service
     if (sliderClient) {
@@ -202,6 +206,60 @@ public abstract class YarnMiniClusterTestBase extends ServiceLauncherBaseTest {
     }
   }
 
+  /**
+   * Work out if kill is supported
+   */
+  @BeforeClass 
+  public static void checkKillSupport() {
+    if (!Shell.WINDOWS) {
+      kill_supported = true;
+    } else {
+      kill_supported = doesWindowsAppExist(["xargs", "--version"])
+    }
+  }
+
+  /**
+   * Kill any java process with the given grep pattern
+   * @param grepString string to grep for
+   */
+  public int killJavaProcesses(String grepString, int signal) {
+
+    def commandString
+    if (!Shell.WINDOWS) {
+      GString killCommand = "jps -l| grep ${grepString} | awk '{print \$1}' | xargs kill $signal"
+      log.info("Command command = $killCommand")
+
+      commandString = ["bash", "-c", killCommand]
+    } else {
+      // windows
+      if (!kill_supported) {
+        return -1;
+      }
+
+      /*
+      "jps -l | grep "String" | awk "{print $1}" | xargs -n 1 taskkill /PID"
+       */
+      GString killCommand = "\"jps -l | grep \"${grepString}\" | gawk \"{print \$1}\" | xargs -n 1 taskkill /f /PID\""
+      commandString = ["CMD", "/C", killCommand]
+    }
+    Process command = commandString.execute()
+    def exitCode = command.waitFor()
+
+    log.info(command.in.text)
+    log.error(command.err.text)
+    return exitCode
+  }
+
+  /**
+   * Kill all processes which match one of the list of grepstrings
+   * @param greps
+   * @param signal
+   */
+  public void killJavaProcesses(List<String> greps, int signal) {
+    for (String grep : greps) {
+      killJavaProcesses(grep, signal)
+    }
+  }
 
   protected YarnConfiguration getConfiguration() {
     return SLIDER_CONFIG;

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9cc24d00/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/AccumuloTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/AccumuloTestBase.groovy b/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/AccumuloTestBase.groovy
index 3c5606b..2a87cf0 100644
--- a/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/AccumuloTestBase.groovy
+++ b/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/AccumuloTestBase.groovy
@@ -71,7 +71,7 @@ public abstract class AccumuloTestBase extends YarnZKMiniClusterTestBase {
   @Override
   void teardown() {
     super.teardown();
-    if (teardownKillall) {
+    if (teardownKillall && kill_supported) {
       try {
         killAllAccumuloProcesses();
       } catch (AssumptionViolatedException e) {

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9cc24d00/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/live/TestAccFreezeThaw.groovy
----------------------------------------------------------------------
diff --git a/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/live/TestAccFreezeThaw.groovy b/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/live/TestAccFreezeThaw.groovy
index 3d0c03f..fcb73e0 100644
--- a/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/live/TestAccFreezeThaw.groovy
+++ b/slider-providers/accumulo/slider-accumulo-provider/src/test/groovy/org/apache/slider/providers/accumulo/live/TestAccFreezeThaw.groovy
@@ -87,7 +87,9 @@ class TestAccFreezeThaw extends AccumuloTestBase {
       log.debug("expected exception", expected)
     }
     //force kill any accumulo processes
-    killAllAccumuloProcesses()
+    if (kill_supported) {
+      killAllAccumuloProcesses()
+    }
 
     sleepForAccumuloClusterLive();
 


[06/24] incubator-slider git commit: pre-SLIDER-622: fix declaration of powermock and jettison versions in root POM

Posted by st...@apache.org.
pre-SLIDER-622: fix declaration of powermock and jettison versions in root POM


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

Branch: refs/heads/develop
Commit: efc9922be14181ff3800c8496154fb9ee92b0f2c
Parents: 63148ff
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 16:59:12 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 16:59:12 2014 +0000

----------------------------------------------------------------------
 pom.xml | 59 ++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 30 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/efc9922b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5b58597..2001e4e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1267,36 +1267,37 @@
         <version>${jetty.version}</version>
       </dependency>
 
+      <dependency>
+        <groupId>org.codehaus.jettison</groupId>
+        <artifactId>jettison</artifactId>
+        <version>1.1</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.powermock</groupId>
+        <artifactId>powermock-core</artifactId>
+        <version>1.5</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.powermock</groupId>
+        <artifactId>powermock-reflect</artifactId>
+        <version>1.5</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.powermock</groupId>
+        <artifactId>powermock-api-easymock</artifactId>
+        <version>1.5</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.powermock</groupId>
+        <artifactId>powermock-module-junit4</artifactId>
+        <version>1.5</version>
+      </dependency>
+
     </dependencies>
-    <dependency>
-      <groupId>org.codehaus.jettison</groupId>
-      <artifactId>jettison</artifactId>
-      <version>1.1</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-core</artifactId>
-      <version>1.5</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-reflect</artifactId>
-      <version>1.5</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-api-easymock</artifactId>
-      <version>1.5</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.powermock</groupId>
-      <artifactId>powermock-module-junit4</artifactId>
-      <version>1.5</version>
-    </dependency>
     
   </dependencyManagement>
 


[16/24] incubator-slider git commit: SLIDER-622 & then cut checks for awk and xargs

Posted by st...@apache.org.
SLIDER-622 & then cut checks for awk and xargs


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

Branch: refs/heads/develop
Commit: 03a670a485bfbf31ef257c648815a8719d102287
Parents: bbc2f0a
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 21:06:20 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 21:06:20 2014 +0000

----------------------------------------------------------------------
 .../org/apache/slider/common/tools/TestWindowsSupport.groovy     | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/03a670a4/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
index 769233e..198bd82 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
@@ -104,17 +104,21 @@ class TestWindowsSupport extends YarnMiniClusterTestBase {
   }
 
 
+/*
   @Test
   public void testHasGawkInstalled() throws Throwable {
     assume(Shell.WINDOWS, "not windows")
     exec(0, ["gawk", "--version"])
   }
+*/
 
+/*
   @Test
   public void testHasXargsInstalled() throws Throwable {
     assume(Shell.WINDOWS, "not windows")
     exec(0, ["xargs", "--version"])
   }
+*/
 
   @Test
   public void testExecNonexistentBinary() throws Throwable {


[15/24] incubator-slider git commit: SLIDER-622 simplify check for kill by just disabling it on windows test runs

Posted by st...@apache.org.
SLIDER-622 simplify check for kill by just disabling it on windows test runs


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

Branch: refs/heads/develop
Commit: bbc2f0a67d14821323918542699000ef2f39caf7
Parents: 1d8f318
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 21:00:24 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 21:00:24 2014 +0000

----------------------------------------------------------------------
 .../org/apache/slider/test/YarnMiniClusterTestBase.groovy      | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/bbc2f0a6/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
index d5bad50..78b5fb9 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/YarnMiniClusterTestBase.groovy
@@ -211,11 +211,7 @@ public abstract class YarnMiniClusterTestBase extends ServiceLauncherBaseTest {
    */
   @BeforeClass 
   public static void checkKillSupport() {
-    if (!Shell.WINDOWS) {
-      kill_supported = true;
-    } else {
-      kill_supported = doesWindowsAppExist(["xargs", "--version"])
-    }
+    kill_supported = !Shell.WINDOWS
   }
 
   /**


[03/24] incubator-slider git commit: SLIDER-622 possible bug/race in EndOfServiceWaiter

Posted by st...@apache.org.
SLIDER-622 possible bug/race in EndOfServiceWaiter


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

Branch: refs/heads/develop
Commit: b277c7921a4a03bb9a1abee38128e69e1a9ca7b0
Parents: 400d069
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 16:47:27 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 16:47:27 2014 +0000

----------------------------------------------------------------------
 .../server/services/utility/EndOfServiceWaiter.java     | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b277c792/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java b/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java
index 6e8add1..4a57133 100644
--- a/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java
+++ b/slider-core/src/main/java/org/apache/slider/server/services/utility/EndOfServiceWaiter.java
@@ -35,6 +35,7 @@ public class EndOfServiceWaiter implements ServiceStateChangeListener {
 
   private final AtomicBoolean finished = new AtomicBoolean(false);
   private final String name;
+  private Service service;
 
   /**
    * Wait for a service; use the service name as this instance's name
@@ -52,6 +53,7 @@ public class EndOfServiceWaiter implements ServiceStateChangeListener {
    */
   public EndOfServiceWaiter(String name, Service service) {
     this.name = name;
+    this.service = service;
     service.registerServiceListener(this);
   }
 
@@ -59,11 +61,11 @@ public class EndOfServiceWaiter implements ServiceStateChangeListener {
       InterruptedException, TimeoutException {
     if (!finished.get()) {
       wait(timeout);
-    }
-    if (!finished.get()) {
-      throw new TimeoutException(name
-               + " did not finish after " + timeout +
-               " milliseconds");
+      if (!finished.get()) {
+        throw new TimeoutException(name
+                                   + " did not finish after " + timeout +
+                                   " milliseconds");
+      }
     }
   }
 


[08/24] incubator-slider git commit: SLIDER-622 moved exec operations

Posted by st...@apache.org.
SLIDER-622 moved exec operations


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

Branch: refs/heads/develop
Commit: 290a5e890d245304b00af99006709a0584241846
Parents: 1ea195d
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 17:50:12 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 17:50:12 2014 +0000

----------------------------------------------------------------------
 .../apache/slider/test/SliderTestUtils.groovy   | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/290a5e89/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
index 634b6b5..8d6c036 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
@@ -28,6 +28,7 @@ import org.apache.hadoop.conf.Configuration
 import org.apache.hadoop.fs.FileStatus
 import org.apache.hadoop.fs.FileSystem as HadoopFS
 import org.apache.hadoop.fs.Path
+import org.apache.hadoop.service.ServiceStateException
 import org.apache.hadoop.util.Shell
 import org.apache.hadoop.yarn.api.records.ApplicationReport
 import org.apache.hadoop.yarn.conf.YarnConfiguration
@@ -46,6 +47,7 @@ import org.apache.slider.core.exceptions.WaitTimeoutException
 import org.apache.slider.core.main.ServiceLaunchException
 import org.apache.slider.core.main.ServiceLauncher
 import org.apache.slider.core.registry.docstore.PublishedConfigSet
+import org.apache.slider.server.services.workflow.ForkedProcessService
 import org.junit.Assert
 import org.junit.Assume
 
@@ -520,6 +522,45 @@ class SliderTestUtils extends Assert {
     int actual = instances != null ? instances.size() : 0
     return actual
   }
+  /**
+   * Exec a set of commands, wait a few seconds for it to finish.
+   * @param status code
+   * @param commands
+   * @return the process
+   */
+  public static ForkedProcessService exec(int status, List<String> commands) {
+    ForkedProcessService process = exec(commands)
+    assert status == process.exitCode
+    return process
+  }
+  /**
+     * Exec a set of commands, wait a few seconds for it to finish.
+     * @param commands
+     * @return
+     */
+  public static ForkedProcessService exec(List<String> commands) {
+    ForkedProcessService process;
+    process = new ForkedProcessService(
+        commands[0],
+        [:],
+        commands);
+    process.init(new Configuration());
+    process.start();
+    process.waitForServiceToStop(10000);
+    process
+  }
+
+  public static boolean doesWindowsAppExist(List<String> commands) {
+    try {
+      exec(0, commands)
+      return true;
+    } catch (ServiceStateException e) {
+      if (!(e.cause instanceof FileNotFoundException)) {
+        throw e;
+      }
+      return false;
+    }
+  }
 
   /**
    * Execute a closure, assert it fails with a given exit code and text


[13/24] incubator-slider git commit: SLIDER-622 scanning for the DLL on the path

Posted by st...@apache.org.
SLIDER-622 scanning for the DLL on the path


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

Branch: refs/heads/develop
Commit: 81402edfeeb4ac88ffa0c7ac82b71fc3bf952cbc
Parents: 9b3fd8c
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 20:38:30 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 20:38:30 2014 +0000

----------------------------------------------------------------------
 .../common/tools/TestWindowsSupport.groovy      | 64 +++++++++++++++-----
 1 file changed, 50 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/81402edf/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
index cbd79a4..769233e 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestWindowsSupport.groovy
@@ -28,7 +28,6 @@ import org.apache.hadoop.fs.FileSystem as HadoopFS
 import org.apache.hadoop.service.ServiceStateException
 import org.apache.hadoop.util.Shell
 import org.apache.slider.providers.agent.AgentUtils
-import org.apache.slider.test.SliderTestBase
 import org.apache.slider.test.YarnMiniClusterTestBase
 import org.junit.Test
 
@@ -68,8 +67,8 @@ class TestWindowsSupport extends YarnMiniClusterTestBase {
   
   @Test
   public void testPathHandling() throws Throwable {
-    assume(Shell.WINDOWS, "not windows")
-    
+    assumeWindows()
+
     Path path = new Path(windowsFile);
     def uri = path.toUri()
 //    assert "file" == uri.scheme 
@@ -95,14 +94,13 @@ class TestWindowsSupport extends YarnMiniClusterTestBase {
 
   @Test
   public void testSliderFS() throws Throwable {
-    assume(Shell.WINDOWS, "not windows")
+    assumeWindows()
     SliderFileSystem sfs = new SliderFileSystem(new Configuration())
     try {
       def metainfo = AgentUtils.getApplicationMetainfo(sfs, windowsFile)
     } catch (FileNotFoundException fnfe) {
       // expected
     }
-    
   }
 
 
@@ -133,10 +131,14 @@ class TestWindowsSupport extends YarnMiniClusterTestBase {
   }
   @Test
   public void testExecNonexistentBinary2() throws Throwable {
-    assume(Shell.WINDOWS, "not windows")
+    assumeWindows()
     assert !doesWindowsAppExist(["undefined-application", "--version"])
   }
 
+  public assumeWindows() {
+    assume(Shell.WINDOWS, "not windows")
+  }
+
   @Test
   public void testEmitKillCommand() throws Throwable {
 
@@ -147,20 +149,20 @@ class TestWindowsSupport extends YarnMiniClusterTestBase {
 
   @Test
   public void testHadoopHomeDefined() throws Throwable {
-    assume(Shell.WINDOWS, "not windows")
+    assumeWindows()
     def hadoopHome = Shell.hadoopHome
     log.info("HADOOP_HOME=$hadoopHome")
   }
   
   @Test
   public void testHasWinutils() throws Throwable {
-    assume(Shell.WINDOWS, "not windows")
+    assumeWindows()
     SliderUtils.maybeVerifyWinUtilsValid()
   }
 
   @Test
   public void testExecWinutils() throws Throwable {
-    assume(Shell.WINDOWS, "not windows")
+    assumeWindows()
     def winUtilsPath = Shell.winUtilsPath
     assert winUtilsPath
     File winUtils = new File(winUtilsPath)
@@ -169,11 +171,45 @@ class TestWindowsSupport extends YarnMiniClusterTestBase {
     exec(0, [winUtilsPath, "systeminfo"])
   }
 
-
   @Test
   public void testPath() throws Throwable {
-    String pathkey;
-    
+    String path = extractPath()
+    log.info("Path value = $path")
+  }
+
+  @Test
+  public void testFindJavac() throws Throwable {
+    String name = Shell.WINDOWS ? "javac.exe" : "javac"
+    assert locateExecutable(name)
+  }
+  
+  @Test
+  public void testHadoopDLL() throws Throwable {
+    assumeWindows()
+    // split the path
+    File exepath = locateExecutable("HADOOP.DLL")
+    assert exepath
+    log.info "Hadoop DLL at: $exepath"
+  }
+
+  public File locateExecutable(String exe) {
+    File exepath = null
+    String path = extractPath()
+    String[] dirs = path.split(System.getProperty("path.separator"));
+    dirs.each { String dirname ->
+      File dir = new File(dirname)
+
+      File possible = new File(dir, exe)
+      if (possible.exists()) {
+        exepath = possible
+      }
+    }
+    return exepath
+  }
+
+  public String extractPath() {
+    String pathkey = "";
+
     System.getenv().keySet().each { String it ->
       if (it.toLowerCase(Locale.ENGLISH).equals("path")) {
         pathkey = it;
@@ -181,7 +217,7 @@ class TestWindowsSupport extends YarnMiniClusterTestBase {
     }
     assert pathkey
     log.info("Path env variable is $pathkey")
-    def pathval = System.getenv(pathkey)
-    log.info("Path value = $pathval")
+    def path = System.getenv(pathkey)
+    return path
   }
 }


[18/24] incubator-slider git commit: SLIDER-622 pull fixup of hadoop/bin from windows profile; needs to be done explicitly

Posted by st...@apache.org.
SLIDER-622 pull fixup of hadoop/bin from windows profile; needs to be done explicitly


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

Branch: refs/heads/develop
Commit: 942791e28b51e163fba5d9331669ca0b7bf31b6e
Parents: 022e929
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 21:43:17 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 21:43:17 2014 +0000

----------------------------------------------------------------------
 pom.xml | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/942791e2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9db17b3..1049e40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1326,9 +1326,6 @@
           <family>windows</family>
         </os>
       </activation>
-      <properties>
-        <test.env.path>${env.PATH}:${project.basedir}\bin\windows\${hadoop.version}\bin}</test.env.path>  
-      </properties>
       <modules>
         <module>app-packages/hbase-win</module>
         <module>app-packages/storm-win</module>


[12/24] incubator-slider git commit: SLIDER-622 trying to automate adding path

Posted by st...@apache.org.
SLIDER-622 trying to automate adding path


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

Branch: refs/heads/develop
Commit: 9b3fd8c0f33b77dc8afea4a888cfc5fb24bcaefe
Parents: a8e17ab
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 20:16:06 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 20:16:06 2014 +0000

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9b3fd8c0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 33fc1ec..9db17b3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1327,7 +1327,7 @@
         </os>
       </activation>
       <properties>
-        <test.env.path>${env.PATH}:{$project.basedir}\bin\windows\${hadoop.version}\bin}</test.env.path>  
+        <test.env.path>${env.PATH}:${project.basedir}\bin\windows\${hadoop.version}\bin}</test.env.path>  
       </properties>
       <modules>
         <module>app-packages/hbase-win</module>


[24/24] incubator-slider git commit: Merge branch 'feature/SLIDER-622-windows' into develop

Posted by st...@apache.org.
Merge branch 'feature/SLIDER-622-windows' into develop


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

Branch: refs/heads/develop
Commit: fc140b52204244f3f834b2095ce99c596edd5b6e
Parents: 62cdd69 81ada23
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 22:45:34 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 22:45:34 2014 +0000

----------------------------------------------------------------------
 pom.xml                                         |  36 +++++-
 slider-core/pom.xml                             |   8 +-
 .../apache/slider/common/tools/SliderUtils.java |  10 +-
 .../services/utility/EndOfServiceWaiter.java    |  13 +-
 .../services/workflow/ForkedProcessService.java |   2 +-
 .../standalone/TestStandaloneAMDestroy.groovy   |   4 +
 .../standalone/TestStandaloneAMKill.groovy      |   4 +-
 .../standalone/TestStandaloneAgentAM.groovy     |   1 +
 .../common/tools/TestWindowsSupport.groovy      | 125 +++++++++++++------
 .../common/tools/TestZKIntegration.groovy       |   4 +-
 .../server/appmaster/actions/TestActions.groovy |   2 +-
 .../apache/slider/test/SliderTestUtils.groovy   |  88 +++++++------
 .../slider/test/YarnMiniClusterTestBase.groovy  |  59 ++++++++-
 .../test/YarnZKMiniClusterTestBase.groovy       |   2 +-
 .../services/workflow/TestLongLivedProcess.java |   2 -
 .../TestWorkflowForkedProcessService.java       |  23 ++--
 .../providers/accumulo/AccumuloTestBase.groovy  |   2 +-
 .../accumulo/live/TestAccFreezeThaw.groovy      |   4 +-
 18 files changed, 272 insertions(+), 117 deletions(-)
----------------------------------------------------------------------



[14/24] incubator-slider git commit: SLIDER-622 process exit codes

Posted by st...@apache.org.
SLIDER-622 process exit codes


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

Branch: refs/heads/develop
Commit: 1d8f3189d5edec52fffa858dad6b98ba4c89767c
Parents: 81402ed
Author: Steve Loughran <st...@apache.org>
Authored: Mon Nov 10 20:55:16 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Nov 10 20:55:16 2014 +0000

----------------------------------------------------------------------
 .../services/workflow/ForkedProcessService.java  |  2 +-
 .../server/appmaster/actions/TestActions.groovy  |  2 +-
 .../apache/slider/test/SliderTestUtils.groovy    | 13 +++++++++++--
 .../TestWorkflowForkedProcessService.java        | 19 ++++++++++++-------
 4 files changed, 25 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1d8f3189/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java b/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java
index b801993..9f6b327 100644
--- a/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java
+++ b/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java
@@ -264,7 +264,7 @@ public class ForkedProcessService
   }
 
 
-  public int getExitCode() {
+  public Integer getExitCode() {
     return process.getExitCode();
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1d8f3189/slider-core/src/test/groovy/org/apache/slider/server/appmaster/actions/TestActions.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/actions/TestActions.groovy b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/actions/TestActions.groovy
index 7e03e7b..a3a0025 100644
--- a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/actions/TestActions.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/actions/TestActions.groovy
@@ -191,7 +191,7 @@ class TestActions {
     queues.renewing("note", renewer)
     assert queues.removeRenewingAction("note")
     queues.stop()
-    queues.waitForServiceToStop(10000)
+    assert queues.waitForServiceToStop(10000)
   }
   
   public class ActionNoteExecuted extends AsyncAction {

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1d8f3189/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
index ad18c72..3688644 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
@@ -51,6 +51,8 @@ import org.apache.slider.server.services.workflow.ForkedProcessService
 import org.junit.Assert
 import org.junit.Assume
 
+import java.util.concurrent.TimeoutException
+
 import static Arguments.ARG_OPTION
 
 /**
@@ -530,7 +532,10 @@ class SliderTestUtils extends Assert {
    */
   public static ForkedProcessService exec(int status, List<String> commands) {
     ForkedProcessService process = exec(commands)
-    assert status == process.exitCode
+
+    def exitCode = process.exitCode
+    assert exitCode != null
+    assert status == exitCode
     return process
   }
   /**
@@ -546,7 +551,11 @@ class SliderTestUtils extends Assert {
         commands);
     process.init(new Configuration());
     process.start();
-    process.waitForServiceToStop(10000);
+    int timeoutMillis = 5000
+    if (!process.waitForServiceToStop(timeoutMillis)) {
+      throw new TimeoutException(
+          "Process did not stop in " + timeoutMillis + "mS");
+    }
     process
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1d8f3189/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
index cf0afc1..01d5ec9 100644
--- a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
+++ b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
@@ -69,7 +69,9 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
     initProcess(commandFactory.ls(testDir));
     exec();
     assertFalse(process.isProcessRunning());
-    assertEquals(0, process.getExitCode());
+    Integer exitCode = process.getExitCode();
+    assertNotNull("null exit code", exitCode);
+    assertEquals(0, exitCode.intValue());
 
     assertStringInOutput("test-classes", getFinalOutput());
     // assert that the service did not fail
@@ -83,7 +85,8 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
     initProcess(commandFactory.exitFalse());
     exec();
     assertFalse(process.isProcessRunning());
-    int exitCode = process.getExitCode();
+    Integer exitCode = process.getExitCode();
+    assertNotNull("null exit code", exitCode);
     assertTrue(exitCode != 0);
     int corrected = process.getExitCodeSignCorrected();
     assertEquals(1, corrected);
@@ -98,8 +101,9 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
     String echoText = "hello, world";
     initProcess(commandFactory.echo(echoText));
     exec();
-
-    assertEquals(0, process.getExitCode());
+    Integer exitCode = process.getExitCode();
+    assertNotNull("null exit code", exitCode);
+    assertEquals(0, exitCode.intValue());
     assertStringInOutput(echoText, getFinalOutput());
 
   }
@@ -112,8 +116,9 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
     env.put(var, val);
     initProcess(commandFactory.env());
     exec();
-
-    assertEquals(0, process.getExitCode());
+    Integer exitCode = process.getExitCode();
+    assertNotNull("null exit code", exitCode);
+    assertEquals(0, exitCode.intValue());
     assertStringInOutput(val, getFinalOutput());
   }
 
@@ -137,7 +142,7 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
   public void exec() throws InterruptedException, TimeoutException {
     assertNotNull(process);
     process.start();
-    process.waitForServiceToStop(5000);
+    assert process.waitForServiceToStop(5000);
   }
 
 }