hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1487722 - /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
Date Thu, 30 May 2013 04:21:57 GMT
Author: vinodkv
Date: Thu May 30 04:21:57 2013
New Revision: 1487722

URL: http://svn.apache.org/r1487722
Log:
HADOOP-9574. Fix for timing issues in the original patch's test-case.

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

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java?rev=1487722&r1=1487721&r2=1487722&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
Thu May 30 04:21:57 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();
     }



Mime
View raw message