Author: vinodkv
Date: Thu May 30 04:22:48 2013
New Revision: 1487723

URL: http://svn.apache.org/r1487723
Log:
HADOOP-9574. Fix for timing issues in the original patch's test-case.
svn merge --ignore-ancestry -c 1487722 ../../trunk/

Modified:
    
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java

Modified: 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java?rev=1487723&r1=1487722&r2=1487723&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
 (original)
+++ 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
 Thu May 30 04:22:48 2013
@@ -342,7 +342,7 @@ public class TestDelegationToken {
     }
   }
 
-  @Test
+  @Test(timeout = 10000)
   public void testRollMasterKey() throws Exception {
     TestDelegationTokenSecretManager dtSecretManager = 
       new TestDelegationTokenSecretManager(800,
@@ -375,10 +375,10 @@ public class TestDelegationToken {
         dtSecretManager.retrievePassword(identifier);
       //compare the passwords
       Assert.assertEquals(oldPasswd, newPasswd);
-      // wait for keys to exipire
-      Thread.sleep(2200);
-      Assert.assertTrue(dtSecretManager.isRemoveStoredMasterKeyCalled);
-
+      // wait for keys to expire
+      while(!dtSecretManager.isRemoveStoredMasterKeyCalled) {
+        Thread.sleep(200);
+      }
     } finally {
       dtSecretManager.stopThreads();
     }


Reply via email to