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 22:56:22 UTC

[2/6] incubator-slider git commit: SLIDER-622 jenkins failing on windows

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/3e6cf34f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/3e6cf34f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/3e6cf34f

Branch: refs/heads/develop
Commit: 3e6cf34f69a31fde456b744e1530f5646d69de8f
Parents: 0dea0dc
Author: Steve Loughran <st...@apache.org>
Authored: Fri Nov 7 20:29:58 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Fri Nov 7 20:29:58 2014 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3e6cf34f/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)
     }
   }