hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1586192 - 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/TestAMRMTokens.java
Date Thu, 10 Apr 2014 01:36:51 GMT
Author: vinodkv
Date: Thu Apr 10 01:36:50 2014
New Revision: 1586192

URL: http://svn.apache.org/r1586192
Log:
YARN-1910. Fixed a race condition in TestAMRMTokens that causes the test to fail more often
on Windows. Contributed by Xuan Gong.

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/TestAMRMTokens.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=1586192&r1=1586191&r2=1586192&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt Thu Apr 10 01:36:50 2014
@@ -94,6 +94,9 @@ Release 2.4.1 - UNRELEASED
     YARN-1908. Fixed DistributedShell to not fail in secure clusters. (Vinod
     Kumar Vavilapalli and Jian He via vinodkv)
 
+    YARN-1910. Fixed a race condition in TestAMRMTokens that causes the test to
+    fail more often on Windows. (Xuan Gong via vinodkv)
+
 Release 2.4.0 - 2014-04-07 
 
   INCOMPATIBLE CHANGES

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/TestAMRMTokens.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/TestAMRMTokens.java?rev=1586192&r1=1586191&r2=1586192&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/TestAMRMTokens.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/TestAMRMTokens.java
Thu Apr 10 01:36:50 2014
@@ -48,6 +48,7 @@ import org.apache.hadoop.yarn.server.res
 import org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization.MyContainerManager;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt;
+import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptContainerFinishedEvent;
 import org.apache.hadoop.yarn.server.utils.BuilderUtils;
 import org.apache.hadoop.yarn.util.Records;
@@ -63,6 +64,7 @@ public class TestAMRMTokens {
   private static final Log LOG = LogFactory.getLog(TestAMRMTokens.class);
 
   private final Configuration conf;
+  private static final int maxWaitAttempts = 50;
 
   @Parameters
   public static Collection<Object[]> configs() {
@@ -153,6 +155,16 @@ public class TestAMRMTokens {
               new RMAppAttemptContainerFinishedEvent(applicationAttemptId,
                   containerStatus));
 
+      // Make sure the RMAppAttempt is at Finished State.
+      // Both AMRMToken and ClientToAMToken have been removed.
+      int count = 0;
+      while (attempt.getState() != RMAppAttemptState.FINISHED
+          && count < maxWaitAttempts) {
+        Thread.sleep(100);
+        count++;
+      }
+      Assert.assertTrue(attempt.getState() == RMAppAttemptState.FINISHED);
+
       // Now simulate trying to allocate. RPC call itself should throw auth
       // exception.
       rpc.stopProxy(rmClient, conf); // To avoid using cached client



Mime
View raw message