hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1399795 - in /hadoop/common/trunk/hadoop-yarn-project: CHANGES.txt hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java
Date Thu, 18 Oct 2012 19:12:14 GMT
Author: vinodkv
Date: Thu Oct 18 19:12:13 2012
New Revision: 1399795

URL: http://svn.apache.org/viewvc?rev=1399795&view=rev
Log:
YARN-32. Fix TestApplicationTokens to not depend on test order and thus pass on JDK7. Contributed
by Vinod Kumar Vavilapalli.

Modified:
    hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt
    hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java

Modified: hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt?rev=1399795&r1=1399794&r2=1399795&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt Thu Oct 18 19:12:13 2012
@@ -151,6 +151,9 @@ Release 0.23.5 - UNRELEASED
     YARN-43. Fix TestResourceTrackerService to not depend on test order and thus
     pass on JDK7. (Thomas Graves via vinodkv)
 
+    YARN-32. Fix TestApplicationTokens to not depend on test order and thus pass
+    on JDK7. (vinodkv)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java?rev=1399795&r1=1399794&r2=1399795&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java
(original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestApplicationTokens.java
Thu Oct 18 19:12:13 2012
@@ -64,6 +64,10 @@ public class TestApplicationTokens {
     final MockRM rm = new MockRMWithAMS(new Configuration(), containerManager);
     rm.start();
 
+    final Configuration conf = rm.getConfig();
+    final YarnRPC rpc = YarnRPC.create(conf);
+    AMRMProtocol rmClient = null;
+
     try {
       MockNM nm1 = rm.registerNode("localhost:1234", 5120);
 
@@ -82,9 +86,6 @@ public class TestApplicationTokens {
       ApplicationAttemptId applicationAttemptId = attempt.getAppAttemptId();
 
       // Create a client to the RM.
-      final Configuration conf = rm.getConfig();
-      final YarnRPC rpc = YarnRPC.create(conf);
-
       UserGroupInformation currentUser =
           UserGroupInformation
             .createRemoteUser(applicationAttemptId.toString());
@@ -96,7 +97,7 @@ public class TestApplicationTokens {
       token.decodeFromUrlString(tokenURLEncodedStr);
       currentUser.addToken(token);
 
-      AMRMProtocol rmClient = createRMClient(rm, conf, rpc, currentUser);
+      rmClient = createRMClient(rm, conf, rpc, currentUser);
 
       RegisterApplicationMasterRequest request =
           Records.newRecord(RegisterApplicationMasterRequest.class);
@@ -136,6 +137,9 @@ public class TestApplicationTokens {
 
     } finally {
       rm.stop();
+      if (rmClient != null) {
+        rpc.stopProxy(rmClient, conf); // To avoid using cached client
+      }
     }
   }
 
@@ -153,6 +157,10 @@ public class TestApplicationTokens {
     final MockRM rm = new MockRMWithAMS(config, containerManager);
     rm.start();
 
+    final Configuration conf = rm.getConfig();
+    final YarnRPC rpc = YarnRPC.create(conf);
+    AMRMProtocol rmClient = null;
+
     try {
       MockNM nm1 = rm.registerNode("localhost:1234", 5120);
 
@@ -171,9 +179,6 @@ public class TestApplicationTokens {
       ApplicationAttemptId applicationAttemptId = attempt.getAppAttemptId();
 
       // Create a client to the RM.
-      final Configuration conf = rm.getConfig();
-      final YarnRPC rpc = YarnRPC.create(conf);
-
       UserGroupInformation currentUser =
           UserGroupInformation
             .createRemoteUser(applicationAttemptId.toString());
@@ -185,7 +190,7 @@ public class TestApplicationTokens {
       token.decodeFromUrlString(tokenURLEncodedStr);
       currentUser.addToken(token);
 
-      AMRMProtocol rmClient = createRMClient(rm, conf, rpc, currentUser);
+      rmClient = createRMClient(rm, conf, rpc, currentUser);
 
       RegisterApplicationMasterRequest request =
           Records.newRecord(RegisterApplicationMasterRequest.class);
@@ -217,6 +222,9 @@ public class TestApplicationTokens {
         .getReboot());
     } finally {
       rm.stop();
+      if (rmClient != null) {
+        rpc.stopProxy(rmClient, conf); // To avoid using cached client
+      }
     }
   }
 



Mime
View raw message