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:14 UTC

[11/12] 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/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)
     }
   }