From 9ae713ef58d4defb746b5ba9dfbcaf5ee0656a8a Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Thu, 30 May 2013 04:21:57 +0000 Subject: [PATCH] HADOOP-9574. Fix for timing issues in the original patch's test-case. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1487722 13f79535-47bb-0310-9956-ffa450edef68 --- .../security/token/delegation/TestDelegationToken.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java index c6b32981acf..60f0fe0c1bf 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java @@ -342,7 +342,7 @@ public Object run() throws Exception { } } - @Test + @Test(timeout = 10000) public void testRollMasterKey() throws Exception { TestDelegationTokenSecretManager dtSecretManager = new TestDelegationTokenSecretManager(800, @@ -375,10 +375,10 @@ public void testRollMasterKey() throws Exception { 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(); }