HADOOP-9574. Fix for timing issues in the original patch's test-case.

svn merge --ignore-ancestry -c 1487722 ../../trunk/


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1487723 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2013-05-30 04:22:48 +00:00
parent dfa5f198f0
commit f1a216b603
1 changed files with 5 additions and 5 deletions

View File

@ -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();
}