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/08 23:30:04 UTC

[01/12] incubator-slider git commit: SLIDER-623 python exec failing

Repository: incubator-slider
Updated Branches:
  refs/heads/releases/slider-0.60 7af5a7889 -> 16be5ef63


SLIDER-623 python exec failing


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

Branch: refs/heads/releases/slider-0.60
Commit: 141b820627ba7b67ee2b781c66649f519518fc4f
Parents: 7af5a78
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 12:14:25 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:48:34 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/141b8206/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 82b17fd..a8f8608 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
@@ -1963,7 +1963,7 @@ public final class SliderUtils {
       SliderException {
     maybeVerifyWinUtilsValid(logger);
     execCommand(OPENSSL, 0, 5000, logger, "OpenSSL", OPENSSL, "version");
-    execCommand(PYTHON, 0, 5000, logger, "Python", PYTHON, "--version");
+    execCommand(PYTHON, 0, 5000, logger, "Python", PYTHON, "-V");
   }
 
   /**


[04/12] incubator-slider git commit: code cleanup: rm unused constant and some imports

Posted by st...@apache.org.
code cleanup: rm unused constant and some imports


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

Branch: refs/heads/releases/slider-0.60
Commit: 315581ac3cfe222c9cbfd82b00955463926c02dd
Parents: 58a6c61
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 19:18:42 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:53:38 2014 +0000

----------------------------------------------------------------------
 .../org/apache/slider/server/appmaster/web/WebAppApiImpl.java  | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/315581ac/slider-core/src/main/java/org/apache/slider/server/appmaster/web/WebAppApiImpl.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/WebAppApiImpl.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/WebAppApiImpl.java
index cacdb3a..3b47ed1 100644
--- a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/WebAppApiImpl.java
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/WebAppApiImpl.java
@@ -18,8 +18,6 @@ package org.apache.slider.server.appmaster.web;
 
 import org.apache.hadoop.registry.client.api.RegistryOperations;
 import org.apache.slider.api.SliderClusterProtocol;
-import org.apache.slider.common.SliderKeys;
-import org.apache.slider.providers.ProviderRole;
 import org.apache.slider.providers.ProviderService;
 import org.apache.slider.server.appmaster.state.RoleStatus;
 import org.apache.slider.server.appmaster.state.StateAccessForProviders;
@@ -28,10 +26,8 @@ import org.apache.slider.server.services.security.CertificateManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.TreeMap;
 
 import static com.google.common.base.Preconditions.checkNotNull;
@@ -42,8 +38,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
 public class WebAppApiImpl implements WebAppApi {
   private static final Logger log = LoggerFactory.getLogger(WebAppApiImpl.class);
 
-  protected static final ProviderRole AM_ROLE_NAME = new ProviderRole("Slider Application Master", SliderKeys.ROLE_AM_PRIORITY_INDEX);
-
   protected final SliderClusterProtocol clusterProto;
   protected final StateAccessForProviders appState;
   protected final ProviderService provider;


[02/12] incubator-slider git commit: SLIDER-201 split environment checks into separate methods for isolated testing

Posted by st...@apache.org.
SLIDER-201 split environment checks into separate methods for isolated testing


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

Branch: refs/heads/releases/slider-0.60
Commit: 7a2bf64f0ff4fdbae2e28c26446e40cc292d9c73
Parents: 141b820
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 14:40:20 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:51:48 2014 +0000

----------------------------------------------------------------------
 .../org/apache/slider/common/tools/SliderUtils.java   | 14 +++++++++++++-
 .../common/tools/TestExecutionEnvironment.groovy      | 10 +++++++++-
 .../slider/common/tools/TestWindowsSupport.groovy     |  2 +-
 3 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7a2bf64f/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 a8f8608..74e0bfb 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
@@ -1962,10 +1962,22 @@ public final class SliderUtils {
       IOException,
       SliderException {
     maybeVerifyWinUtilsValid(logger);
-    execCommand(OPENSSL, 0, 5000, logger, "OpenSSL", OPENSSL, "version");
+    validatePythonEnv(logger);
+    validateOpenSSLEnv(logger);
+  }
+
+  public static void validateOpenSSLEnv(Logger logger) throws
+      IOException,
+      SliderException {
     execCommand(PYTHON, 0, 5000, logger, "Python", PYTHON, "-V");
   }
 
+  public static void validatePythonEnv(Logger logger) throws
+      IOException,
+      SliderException {
+    execCommand(OPENSSL, 0, 5000, logger, "OpenSSL", OPENSSL, "version");
+  }
+
   /**
    * return the path to the currently running slider command
    *

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7a2bf64f/slider-core/src/test/groovy/org/apache/slider/common/tools/TestExecutionEnvironment.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestExecutionEnvironment.groovy b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestExecutionEnvironment.groovy
index 5489366..7ca6c49 100644
--- a/slider-core/src/test/groovy/org/apache/slider/common/tools/TestExecutionEnvironment.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/common/tools/TestExecutionEnvironment.groovy
@@ -32,11 +32,19 @@ class TestExecutionEnvironment extends SliderTestBase {
     SliderUtils.validateSliderClientEnvironment(log)
   }
   
-  
   @Test
   public void testServerEnv() throws Throwable {
     SliderUtils.validateSliderServerEnvironment(log)
   }
   
+  @Test
+  public void testopenSSLEnv() throws Throwable {
+    SliderUtils.validateOpenSSLEnv(log)
+  }
+  
+  @Test
+  public void testValidatePythonEnv() throws Throwable {
+    SliderUtils.validatePythonEnv(log)
+  }
   
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7a2bf64f/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 98fa183..61960e6 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
@@ -176,7 +176,7 @@ class TestWindowsSupport extends SliderTestBase {
     process.init(new Configuration());
     EndOfServiceWaiter waiter = new EndOfServiceWaiter(process);
     process.start();
-    waiter.waitForServiceToStop(5000);
+    waiter.waitForServiceToStop(10000);
     process
   }
 }


[08/12] incubator-slider git commit: SLIDER-622 jenkins failing on windows - fix regression

Posted by st...@apache.org.
SLIDER-622 jenkins failing on windows - fix regression


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

Branch: refs/heads/releases/slider-0.60
Commit: 30afdf371c721a95dfff468954070487ee7278b0
Parents: f7c1ac6
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 21:28:24 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:54:05 2014 +0000

----------------------------------------------------------------------
 .../slider/server/appmaster/TestDelayInContainerLaunch.groovy      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/30afdf37/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
index f32b843..5e6226e 100644
--- a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
@@ -100,7 +100,7 @@ class TestDelayInContainerLaunch extends AgentTestBase {
     long delay = 30
 
     TestDelayingSliderClient.delay = delay
-    sliderClientClassName = TestDelayingSliderClient
+    sliderClientClassName = TestDelayingSliderClient.name
     try {
       ServiceLauncher<SliderClient> launcher = buildAgentCluster(clustername,
         roles,


[07/12] incubator-slider git commit: SLIDER-201 closing process input stream on fork

Posted by st...@apache.org.
SLIDER-201 closing process input stream on fork


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

Branch: refs/heads/releases/slider-0.60
Commit: b6a3b541ea5ae7d402fb3b90a6aa0245c44b3b34
Parents: 5d25442
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 17:24:02 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:53:38 2014 +0000

----------------------------------------------------------------------
 .../apache/slider/server/services/workflow/LongLivedProcess.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b6a3b541/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
index 57b989c..cebb035 100644
--- a/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
+++ b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
@@ -51,6 +51,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
  * Key Features:
  * <ol>
  *   <li>Output is streamed to the output logger provided</li>.
+ *   <li>the input stream is closed as soon as the process starts.</li>
  *   <li>The most recent lines of output are saved to a linked list</li>.
  *   <li>A synchronous callback, {@link LongLivedProcessLifecycleEvent}, is raised on the start
  *   and finish of a process.</li>
@@ -323,6 +324,8 @@ public class LongLivedProcess implements Runnable {
       lifecycleCallback.onProcessStarted(this);
     }
     try {
+      //close stdin for the process
+      IOUtils.closeStream(process.getOutputStream());
       exitCode = process.waitFor();
     } catch (InterruptedException e) {
       LOG.debug("Process wait interrupted -exiting thread", e);
@@ -416,6 +419,7 @@ public class LongLivedProcess implements Runnable {
     }
     return getRecentOutput();
   }
+
   /**
    * add the recent line to the list of recent lines; deleting
    * an earlier on if the limit is reached.


[03/12] incubator-slider git commit: SLIDER-621 env check operations

Posted by st...@apache.org.
SLIDER-621 env check 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/5d25442f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/5d25442f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/5d25442f

Branch: refs/heads/releases/slider-0.60
Commit: 5d25442ff38e286dadf58b1abeb33628f35472a3
Parents: 7a2bf64
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 15:59:10 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:52:02 2014 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5d25442f/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 74e0bfb..1a9b8fb 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
@@ -1969,13 +1969,13 @@ public final class SliderUtils {
   public static void validateOpenSSLEnv(Logger logger) throws
       IOException,
       SliderException {
-    execCommand(PYTHON, 0, 5000, logger, "Python", PYTHON, "-V");
+    execCommand(OPENSSL, 0, 5000, logger, "OpenSSL", OPENSSL, "version");
   }
 
   public static void validatePythonEnv(Logger logger) throws
       IOException,
       SliderException {
-    execCommand(OPENSSL, 0, 5000, logger, "OpenSSL", OPENSSL, "version");
+    execCommand(PYTHON, 0, 5000, logger, "Python", PYTHON, "-V");
   }
 
   /**


[12/12] incubator-slider git commit: SLIDER-622 jenkins failing on windows - naming/CNFE problems

Posted by st...@apache.org.
SLIDER-622 jenkins failing on windows - naming/CNFE 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/16be5ef6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/16be5ef6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/16be5ef6

Branch: refs/heads/releases/slider-0.60
Commit: 16be5ef6346ccb983d09488296a27d150660dc84
Parents: 30afdf3
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 21:34:14 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:54:06 2014 +0000

----------------------------------------------------------------------
 .../server/appmaster/TestDelayInContainerLaunch.groovy | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/16be5ef6/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
index 5e6226e..26a2c95 100644
--- a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
@@ -18,21 +18,16 @@
 
 package org.apache.slider.server.appmaster
 
-import groovy.transform.CompileStatic
 import groovy.util.logging.Slf4j
 import org.apache.hadoop.fs.Path
-import org.apache.hadoop.yarn.api.records.ApplicationId
-import org.apache.hadoop.yarn.api.records.ApplicationReport
 import org.apache.hadoop.yarn.conf.YarnConfiguration
 import org.apache.hadoop.yarn.exceptions.YarnException
 import org.apache.slider.api.ClusterDescription
 import org.apache.slider.api.ResourceKeys
 import org.apache.slider.client.SliderClient
-import org.apache.slider.common.SliderExitCodes
 import org.apache.slider.common.params.ActionKillContainerArgs
 import org.apache.slider.core.build.InstanceBuilder
 import org.apache.slider.core.conf.AggregateConf
-import org.apache.slider.core.exceptions.BadClusterStateException
 import org.apache.slider.core.exceptions.SliderException
 import org.apache.slider.core.launch.LaunchedApplication
 import org.apache.slider.core.main.ServiceLauncher
@@ -99,8 +94,8 @@ class TestDelayInContainerLaunch extends AgentTestBase {
     ];
     long delay = 30
 
-    TestDelayingSliderClient.delay = delay
-    sliderClientClassName = TestDelayingSliderClient.name
+    DelayingSliderClient.delay = delay
+    sliderClientClassName = DelayingSliderClient.name
     try {
       ServiceLauncher<SliderClient> launcher = buildAgentCluster(clustername,
         roles,
@@ -140,7 +135,9 @@ class TestDelayInContainerLaunch extends AgentTestBase {
 
   }
 
-  static class TestDelayingSliderClient extends SliderClient {
+  static class DelayingSliderClient extends SliderClient {
+    
+    
     static long delay
     @Override
     protected void persistInstanceDefinition(boolean overwrite,


[09/12] incubator-slider git commit: SLIDER-622 jenkins failing on windows

Posted by st...@apache.org.
SLIDER-622 jenkins failing on windows


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

Branch: refs/heads/releases/slider-0.60
Commit: f7c1ac6b894960829193889de746706c0178bdea
Parents: 6fcae9f
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 20:45:59 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:54:05 2014 +0000

----------------------------------------------------------------------
 .../apache/slider/agent/standalone/TestStandaloneAgentAM.groovy    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/f7c1ac6b/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 b525ea6..7987661 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
@@ -45,7 +45,7 @@ import org.junit.Test
 class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
   
   @After
-  def clientname() {
+  void fixclientname() {
     sliderClientClassName = DEFAULT_SLIDER_CLIENT
   }
   


[06/12] incubator-slider git commit: SLIDER-201 TestBuildBasicAgent to use proper URIs in paths

Posted by st...@apache.org.
SLIDER-201 TestBuildBasicAgent to use proper URIs in paths


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

Branch: refs/heads/releases/slider-0.60
Commit: 58a6c6122da50e079148dc0dd7a2e862c01fdeda
Parents: b6a3b54
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 17:47:43 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:53:38 2014 +0000

----------------------------------------------------------------------
 .../providers/agent/AgentClientProvider.java    |  3 +-
 .../providers/agent/TestBuildBasicAgent.groovy  | 72 ++++++++++++--------
 2 files changed, 46 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/58a6c612/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
index d7ae245..0ef8a33 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentClientProvider.java
@@ -45,6 +45,7 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -131,7 +132,7 @@ public class AgentClientProvider extends AbstractClientProvider
         getGlobalOptions().getMandatoryOption(AgentKeys.APP_DEF);
     log.info("Validating app definition {}", appDef);
     String extension = appDef.substring(appDef.lastIndexOf(".") + 1, appDef.length());
-    if (!"zip".equalsIgnoreCase(extension)) {
+    if (!"zip".equals(extension.toLowerCase(Locale.ENGLISH))) {
       throw new BadConfigException("App definition must be packaged as a .zip file. File provided is " + appDef);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/58a6c612/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy
index 7e352e9..3f7a432 100644
--- a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy
@@ -25,6 +25,7 @@ import org.apache.slider.api.InternalKeys
 import org.apache.slider.api.ResourceKeys
 import org.apache.slider.api.RoleKeys
 import org.apache.slider.client.SliderClient
+import org.apache.slider.common.SliderExitCodes
 import org.apache.slider.common.SliderKeys
 import org.apache.slider.core.conf.AggregateConf
 import org.apache.slider.core.exceptions.BadConfigException
@@ -54,17 +55,32 @@ class TestBuildBasicAgent extends AgentTestBase {
     return new File(app_def_pkg_path);
   }
 
+  private String getAppDefURI() {
+    appDef.toURI().toString()
+  }
+
   private File getBadAppDef() {
     return bad_app_def_path;
   }
 
+  private String getBadAppDefURI() {
+    badAppDef.toURI().toString()
+  }
+
   private File getAgentConf() {
     return agt_conf_path;
   }
 
+  private String getAgentConfURI() {
+    agentConf.toURI().toString()
+  }
+
   private File getAgentImg() {
     return new File(app_def_pkg_path);
   }
+  private String getAgentImgURI() {
+    agentImg.toURI().toString()
+  }
 
 
   @Test
@@ -83,8 +99,8 @@ class TestBuildBasicAgent extends AgentTestBase {
         [
             ARG_OPTION, CONTROLLER_URL, "http://localhost",
             ARG_PACKAGE, ".",
-            ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-            ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+            ARG_OPTION, APP_DEF, appDefURI,
+            ARG_OPTION, AGENT_CONF, agentConfURI,
             ARG_OPTION, SCRIPT_PATH, "agent/scripts/agent.py",
             ARG_COMP_OPT, ROLE_NODE, SCRIPT_PATH, "agent/scripts/agent.py",
             ARG_RES_COMP_OPT, ROLE_NODE, ResourceKeys.COMPONENT_PRIORITY, "1",
@@ -103,8 +119,8 @@ class TestBuildBasicAgent extends AgentTestBase {
         [
             ARG_OPTION, CONTROLLER_URL, "http://localhost",
             ARG_OPTION, PACKAGE_PATH, ".",
-            ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-            ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+            ARG_OPTION, APP_DEF, appDefURI,
+            ARG_OPTION, AGENT_CONF, agentConfURI,
             ARG_COMP_OPT, master, SCRIPT_PATH, "agent/scripts/agent.py",
             ARG_COMP_OPT, rs, SCRIPT_PATH, "agent/scripts/agent.py",
             ARG_RES_COMP_OPT, master, ResourceKeys.COMPONENT_PRIORITY, "2",
@@ -162,8 +178,8 @@ class TestBuildBasicAgent extends AgentTestBase {
           [
               ARG_OPTION, CONTROLLER_URL, "http://localhost",
               ARG_OPTION, PACKAGE_PATH, ".",
-              ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-              ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+              ARG_OPTION, APP_DEF, appDefURI,
+              ARG_OPTION, AGENT_CONF, agentConfURI,
               ARG_COMP_OPT, ROLE_NODE, SCRIPT_PATH, "agent/scripts/agent.py",
               ARG_RES_COMP_OPT, ROLE_NODE, ResourceKeys.COMPONENT_PRIORITY, "1",
           ],
@@ -205,8 +221,8 @@ class TestBuildBasicAgent extends AgentTestBase {
             (rs): 5
         ],
         [
-            ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-            ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+            ARG_OPTION, APP_DEF, appDefURI,
+            ARG_OPTION, AGENT_CONF, agentConfURI,
             ARG_PACKAGE, ".",
             ARG_COMP_OPT, SliderKeys.COMPONENT_AM, RoleKeys.JVM_OPTS, jvmopts,
             ARG_COMP_OPT, master, RoleKeys.JVM_OPTS, jvmopts,
@@ -235,8 +251,8 @@ class TestBuildBasicAgent extends AgentTestBase {
             "hbase-rs": 1,
         ],
         [
-            ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-            ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+            ARG_OPTION, APP_DEF, appDefURI,
+            ARG_OPTION, AGENT_CONF, agentConfURI,
             ARG_PACKAGE, ".",
             ARG_RES_COMP_OPT, "hbase-rs", ResourceKeys.COMPONENT_PRIORITY, "3",
         ],
@@ -261,7 +277,7 @@ class TestBuildBasicAgent extends AgentTestBase {
           [
               ARG_OPTION, CONTROLLER_URL, "http://localhost",
               ARG_PACKAGE, ".",
-              ARG_OPTION, APP_DEF, "file://" + appDef.absolutePath,
+              ARG_OPTION, APP_DEF, appDefURI,
               ARG_RESOURCES, TEST_FILES + "good/resources_with_label.json",
               ARG_TEMPLATE, TEST_FILES + "good/appconf.json"
           ],
@@ -320,8 +336,8 @@ class TestBuildBasicAgent extends AgentTestBase {
         [
             ARG_OPTION, CONTROLLER_URL, "http://localhost",
             ARG_OPTION, PACKAGE_PATH, ".",
-            ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-            ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+            ARG_OPTION, APP_DEF, appDefURI,
+            ARG_OPTION, AGENT_CONF, agentConfURI,
             ARG_COMP_OPT, master, SCRIPT_PATH, "agent/scripts/agent.py",
             ARG_COMP_OPT, rs, SCRIPT_PATH, "agent/scripts/agent.py",
             ARG_RES_COMP_OPT, master, ResourceKeys.COMPONENT_PRIORITY, "2",
@@ -359,8 +375,8 @@ class TestBuildBasicAgent extends AgentTestBase {
         [
             ARG_OPTION, CONTROLLER_URL, "http://localhost",
             ARG_OPTION, PACKAGE_PATH, ".",
-            ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-            ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+            ARG_OPTION, APP_DEF, appDefURI,
+            ARG_OPTION, AGENT_CONF, agentConfURI,
             ARG_COMP_OPT, master, SCRIPT_PATH, "agent/scripts/agent.py",
             ARG_COMP_OPT, rs, SCRIPT_PATH, "agent/scripts/agent.py",
             ARG_RES_COMP_OPT, master, ResourceKeys.COMPONENT_PRIORITY, "4",
@@ -416,7 +432,7 @@ class TestBuildBasicAgent extends AgentTestBase {
           [
               ARG_OPTION, CONTROLLER_URL, "http://localhost",
               ARG_PACKAGE, ".",
-              ARG_OPTION, APP_DEF, "file://" + appDef.absolutePath,
+              ARG_OPTION, APP_DEF, appDefURI,
               ARG_RESOURCES, TEST_FILES + "good/resources.json",
               ARG_TEMPLATE, TEST_FILES + "good/appconf.json"
           ],
@@ -447,7 +463,7 @@ class TestBuildBasicAgent extends AgentTestBase {
           [
               ARG_OPTION, CONTROLLER_URL, "http://localhost",
               ARG_PACKAGE, ".",
-              ARG_OPTION, APP_DEF, "file://" + appDef.absolutePath,
+              ARG_OPTION, APP_DEF, appDefURI,
               ARG_RESOURCES, TEST_FILES + "bad/resources-3.json",
               ARG_TEMPLATE, TEST_FILES + "good/appconf.json"
           ],
@@ -455,8 +471,8 @@ class TestBuildBasicAgent extends AgentTestBase {
           false)
       failWithBuildSucceeding(badArgs1, "bad component type node")
     } catch (BadConfigException expected) {
-      log.info("Expected failure.", expected)
-      assert expected.message.contains("Component node is not a member of application")
+      assertExceptionDetails(expected, SliderExitCodes.EXIT_BAD_CONFIGURATION,
+        "Component node is not a member of application")
     }
   }
 
@@ -477,7 +493,7 @@ class TestBuildBasicAgent extends AgentTestBase {
           [
               ARG_OPTION, CONTROLLER_URL, "http://localhost",
               ARG_PACKAGE, ".",
-              ARG_OPTION, APP_DEF, "file://" + appDef.absolutePath,
+              ARG_OPTION, APP_DEF, appDefURI,
               ARG_RESOURCES, TEST_FILES + "good/resources.json",
               ARG_TEMPLATE, TEST_FILES + "good/appconf.json",
               ARG_QUEUE, "labeled"
@@ -513,9 +529,9 @@ class TestBuildBasicAgent extends AgentTestBase {
           [:],
           [
               ARG_OPTION, CONTROLLER_URL, "http://localhost",
-              ARG_IMAGE, "file://" + getAgentImg().absolutePath,
-              ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-              ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+              ARG_IMAGE, agentImgURI,
+              ARG_OPTION, APP_DEF, appDefURI,
+              ARG_OPTION, AGENT_CONF, agentConfURI,
               ARG_RESOURCES, TEST_FILES + "good/resources.json",
               ARG_TEMPLATE, TEST_FILES + "good/appconf.json"
           ],
@@ -533,7 +549,7 @@ class TestBuildBasicAgent extends AgentTestBase {
           [:],
           [
               ARG_OPTION, CONTROLLER_URL, "http://localhost",
-              ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+              ARG_OPTION, AGENT_CONF, agentConfURI,
               ARG_PACKAGE, ".",
               ARG_RESOURCES, TEST_FILES + "good/resources.json",
               ARG_TEMPLATE, TEST_FILES + "good/appconf.json"
@@ -552,9 +568,9 @@ class TestBuildBasicAgent extends AgentTestBase {
           [:],
           [
               ARG_OPTION, CONTROLLER_URL, "http://localhost",
-              ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+              ARG_OPTION, AGENT_CONF, agentConfURI,
               ARG_PACKAGE, ".",
-              ARG_OPTION, APP_DEF, "file://" + getBadAppDef().absolutePath,
+              ARG_OPTION, APP_DEF, badAppDefURI,
               ARG_RESOURCES, TEST_FILES + "good/resources.json",
               ARG_TEMPLATE, TEST_FILES + "good/appconf.json"
           ],
@@ -582,8 +598,8 @@ class TestBuildBasicAgent extends AgentTestBase {
         [:],
         [
             ARG_OPTION, CONTROLLER_URL, "http://localhost",
-            ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath,
-            ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath,
+            ARG_OPTION, APP_DEF, appDefURI,
+            ARG_OPTION, AGENT_CONF, agentConfURI,
             ARG_PACKAGE, ".",
             ARG_RESOURCES, TEST_FILES + "good/resources.json",
             ARG_TEMPLATE, TEST_FILES + "good/appconf.json"


[05/12] incubator-slider git commit: SLIDER-622 TestZKIntegration tests failing on windows

Posted by st...@apache.org.
SLIDER-622 TestZKIntegration tests failing on windows


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

Branch: refs/heads/releases/slider-0.60
Commit: 41a90cd432ec022f86a42c16a89d8b85ee0b8534
Parents: 315581a
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 19:22:23 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:53:38 2014 +0000

----------------------------------------------------------------------
 .../org/apache/slider/common/tools/TestZKIntegration.groovy   | 2 +-
 .../test/groovy/org/apache/slider/test/MicroZKCluster.groovy  | 4 ++--
 .../org/apache/slider/test/YarnZKMiniClusterTestBase.groovy   | 7 +++----
 3 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/41a90cd4/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 836edbd..1b7ea52 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
@@ -42,7 +42,7 @@ class TestZKIntegration extends YarnZKMiniClusterTestBase implements KeysForTest
   @Before
   void createCluster() {
     Configuration conf = configuration
-    createMicroZKCluster(conf)
+    createMicroZKCluster(methodName.methodName, conf)
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/41a90cd4/slider-core/src/test/groovy/org/apache/slider/test/MicroZKCluster.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/MicroZKCluster.groovy b/slider-core/src/test/groovy/org/apache/slider/test/MicroZKCluster.groovy
index 3d1a2d7..7affb44 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/MicroZKCluster.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/MicroZKCluster.groovy
@@ -44,8 +44,8 @@ class MicroZKCluster implements Closeable {
     this.conf = conf
   }
 
-  void createCluster() {
-    zkService = new MicroZookeeperService("zookeeper")
+  void createCluster(String name) {
+    zkService = new MicroZookeeperService(name)
     
     zkService.init(conf)
     zkService.start()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/41a90cd4/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 3fae9fd..d5d7ecf 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
@@ -24,7 +24,6 @@ import org.apache.hadoop.conf.Configuration
 import org.apache.hadoop.io.IOUtils
 import org.apache.hadoop.yarn.conf.YarnConfiguration
 import org.apache.hadoop.registry.client.api.RegistryConstants
-import org.apache.slider.common.SliderXmlConfKeys
 import org.apache.slider.core.zk.BlockingZKWatcher
 import org.apache.slider.core.zk.ZKIntegration
 
@@ -101,7 +100,7 @@ public abstract class YarnZKMiniClusterTestBase extends YarnMiniClusterTestBase
                                    int numLogDirs,
                                    boolean startZK,
                                    boolean startHDFS) {
-    createMicroZKCluster(conf)
+    createMicroZKCluster("-${name?:'zk'}", conf)
     conf.setBoolean(RegistryConstants.KEY_REGISTRY_ENABLED, true)
     conf.set(RegistryConstants.KEY_REGISTRY_ZK_QUORUM, ZKBinding)
     name = super.createMiniCluster(name, conf, noOfNodeManagers, numLocalDirs, numLogDirs,
@@ -137,9 +136,9 @@ public abstract class YarnZKMiniClusterTestBase extends YarnMiniClusterTestBase
     return createMiniCluster("", conf, noOfNodeManagers, 1, 1, startZK, false)
   }
 
-  public void createMicroZKCluster(Configuration conf) {
+  public void createMicroZKCluster(String name, Configuration conf) {
     microZKCluster = new MicroZKCluster(new Configuration(conf))
-    microZKCluster.createCluster();
+    microZKCluster.createCluster(name);
   }
 
   void assertHasZKCluster() {


[11/12] incubator-slider git commit: SLIDER-622 jenkins failing on windows

Posted by st...@apache.org.
SLIDER-622 jenkins failing on windows


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

Branch: refs/heads/releases/slider-0.60
Commit: 6fcae9f2b8ebf55a295866dd5edbcfac2493a757
Parents: cd0b37f
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 20:29:58 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:54:05 2014 +0000

----------------------------------------------------------------------
 .../standalone/TestStandaloneAgentAM.groovy     | 45 ++++++++------------
 1 file changed, 18 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6fcae9f2/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 ce726f9..b525ea6 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
@@ -37,25 +37,37 @@ import org.apache.slider.core.launch.LaunchedApplication
 import org.apache.slider.core.main.LauncherExitCodes
 import org.apache.slider.core.main.ServiceLauncher
 import org.apache.slider.core.persist.LockAcquireFailedException
+import org.junit.After
 import org.junit.Test
 
 @CompileStatic
 @Slf4j
 class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
   
+  @After
+  def clientname() {
+    sliderClientClassName = DEFAULT_SLIDER_CLIENT
+  }
+  
   @Test
   public void testStandaloneAgentAM() throws Throwable {
 
     describe "create a standalone AM then perform actions on it"
-
+    sliderClientClassName = ExtendedSliderClient.name
     //launch fake master
     String clustername = createMiniCluster("", configuration, 1, true)
+
+
     ServiceLauncher<SliderClient> launcher =
         createStandaloneAM(clustername, true, false)
     SliderClient client = launcher.service
     addToTeardown(client);
 
     ApplicationReport report = waitForClusterLive(client)
+    URI uri = new URI(report.originalTrackingUrl)
+    assert uri.port in [60000, 60001, 60002, 60003]
+    assert report.rpcPort in [60000, 60001, 60002, 60003]
+
     logReport(report)
     List<ApplicationReport> apps = client.applications;
 
@@ -82,8 +94,6 @@ class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
     assert nodes[0].role == SliderKeys.COMPONENT_AM
 
 
-
-
     String username = client.username
     def serviceRegistryClient = client.yarnAppListClient
     describe("list of all applications")
@@ -168,23 +178,6 @@ class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
     // destroy it
     client.actionDestroy(clustername)
     
-    //create another AM, this time with a port range
-    sliderClientClassName = ExtendedSliderClient.name
-    try {
-      launcher = createStandaloneAM(clustername, true, true)
-      client = launcher.service
-      i2AppID = client.applicationId
-
-      reportFor = client.getApplicationReport(i2AppID)
-      URI uri = new URI(reportFor.originalTrackingUrl)
-      assert uri.port in [60000, 60001, 60002, 60003]
-      assert reportFor.rpcPort in [60000, 60001, 60002, 60003]
-
-      assert 0 == clusterActionFreeze(client, clustername)
-
-    } finally {
-      sliderClientClassName = DEFAULT_SLIDER_CLIENT
-    }
   }
 
 
@@ -194,10 +187,9 @@ class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
                                              Path appconfdir,
                                              InstanceBuilder builder)
     throws IOException, SliderException, LockAcquireFailedException {
-      AggregateConf conf = builder.getInstanceDescription()
-      conf.getAppConfOperations().getGlobalOptions().put(
-          SliderKeys.KEY_ALLOWED_PORT_RANGE,
-          "60000-60003")
+      AggregateConf conf = builder.instanceDescription
+      conf.appConfOperations.
+          globalOptions[SliderKeys.KEY_ALLOWED_PORT_RANGE]= "60000-60003"
       super.persistInstanceDefinition(overwrite, appconfdir, builder)
     }
 
@@ -207,9 +199,8 @@ class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
                                           AggregateConf instanceDefinition,
                                           boolean debugAM)
     throws YarnException, IOException {
-      instanceDefinition.getAppConfOperations().getGlobalOptions().put(
-          SliderKeys.KEY_ALLOWED_PORT_RANGE,
-          "60000-60003")
+      instanceDefinition.appConfOperations.
+          globalOptions[SliderKeys.KEY_ALLOWED_PORT_RANGE] ="60000-60003"
       return super.launchApplication(clustername, clusterDirectory, instanceDefinition, debugAM)
     }
   }


[10/12] incubator-slider git commit: SLIDER-622 jenkins failing on windows

Posted by st...@apache.org.
SLIDER-622 jenkins failing on windows


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

Branch: refs/heads/releases/slider-0.60
Commit: cd0b37f705be8d198ba23226a709ebfdbb2f3591
Parents: 41a90cd
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 19:53:05 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Sat Nov 8 21:54:05 2014 +0000

----------------------------------------------------------------------
 .../slider/agent/standalone/TestStandaloneAgentAM.groovy    | 9 ++++++---
 .../slider/providers/agent/TestAgentAMManagementWS.groovy   | 4 ++--
 .../server/appmaster/TestDelayInContainerLaunch.groovy      | 4 ++--
 .../groovy/org/apache/slider/test/SliderTestBase.groovy     | 5 +----
 .../groovy/org/apache/slider/test/SliderTestUtils.groovy    | 3 ++-
 5 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/cd0b37f7/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 f04583e..ce726f9 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
@@ -165,8 +165,11 @@ class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
         clustername)
     assert instance3.yarnApplicationState >= YarnApplicationState.FINISHED
 
+    // destroy it
+    client.actionDestroy(clustername)
+    
     //create another AM, this time with a port range
-    setSliderClientClassName(TestSliderClient.name)
+    sliderClientClassName = ExtendedSliderClient.name
     try {
       launcher = createStandaloneAM(clustername, true, true)
       client = launcher.service
@@ -180,12 +183,12 @@ class TestStandaloneAgentAM  extends AgentMiniClusterTestBase {
       assert 0 == clusterActionFreeze(client, clustername)
 
     } finally {
-      setSliderClientClassName(SliderClient.name)
+      sliderClientClassName = DEFAULT_SLIDER_CLIENT
     }
   }
 
 
-  static class TestSliderClient extends SliderClient {
+  static class ExtendedSliderClient extends SliderClient {
     @Override
     protected void persistInstanceDefinition(boolean overwrite,
                                              Path appconfdir,

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/cd0b37f7/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy
index 7434c4e..887ca89 100644
--- a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestAgentAMManagementWS.groovy
@@ -124,7 +124,7 @@ class TestAgentAMManagementWS extends AgentTestBase {
     assert agt_ver_path.exists()
     assert agt_conf_path.exists()
     try {
-        setSliderClientClassName(TestSliderClient.name)
+        sliderClientClassName = TestSliderClient.name
         ServiceLauncher<SliderClient> launcher = buildAgentCluster(clustername,
             roles,
             [
@@ -174,7 +174,7 @@ class TestAgentAMManagementWS extends AgentTestBase {
         //TODO: assert failure as actual agent is not started. This test only starts the AM.
         assert RegistrationStatus.FAILED == response.getResponseStatus();
     } finally {
-        setSliderClientClassName(SliderClient.name)
+      sliderClientClassName = DEFAULT_SLIDER_CLIENT
     }
     
   }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/cd0b37f7/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
index 973d3af..f32b843 100644
--- a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/TestDelayInContainerLaunch.groovy
@@ -100,7 +100,7 @@ class TestDelayInContainerLaunch extends AgentTestBase {
     long delay = 30
 
     TestDelayingSliderClient.delay = delay
-    setSliderClientClassName(TestDelayingSliderClient.name)
+    sliderClientClassName = TestDelayingSliderClient
     try {
       ServiceLauncher<SliderClient> launcher = buildAgentCluster(clustername,
         roles,
@@ -134,7 +134,7 @@ class TestDelayInContainerLaunch extends AgentTestBase {
       assert duration/1000 >= delay
 
     } finally {
-      setSliderClientClassName(SliderClient.name)
+      sliderClientClassName = DEFAULT_SLIDER_CLIENT
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/cd0b37f7/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy
index afb07d8..e0798a4 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy
@@ -27,7 +27,6 @@ import org.junit.BeforeClass
 import org.junit.Rule
 import org.junit.rules.TestName
 
-//import java.nio.file.Files
 
 /**
  * Base class for unit tests as well as ones starting mini clusters
@@ -54,10 +53,8 @@ public abstract class SliderTestBase extends SliderTestUtils {
 
   @Before
   public void setup() {
+    sliderClientClassName = DEFAULT_SLIDER_CLIENT
     FileUtil.fullyDelete(new File(SliderXMLConfKeysForTesting.TEST_SECURITY_DIR))
   }
 
-  
-  
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/cd0b37f7/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 3b1d022..e67145e 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
@@ -64,7 +64,8 @@ import static Arguments.ARG_OPTION
 @Slf4j
 @CompileStatic
 class SliderTestUtils extends Assert {
-  static String sliderClientClassName = SliderClient.class.name
+  public static final String DEFAULT_SLIDER_CLIENT = SliderClient.class.name
+  static String sliderClientClassName = DEFAULT_SLIDER_CLIENT
 
   public static void describe(String s) {
     log.info("");