YARN-31. Fix TestDelegationTokenRenewer to not depend on test order so as to pass tests on jdk7. Contributed by Thomas Graves.

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


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1377963 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2012-08-28 03:33:20 +00:00
parent 14b1cf459b
commit 57c4f237e2
2 changed files with 11 additions and 1 deletions

View File

@ -69,3 +69,6 @@ Release 0.23.3 - Unreleased
YARN-39. RM-NM secret-keys should be randomly generated and rolled every
so often. (vinodkv and sseth via sseth)
YARN-31. Fix TestDelegationTokenRenewer to not depend on test order so as to
pass tests on jdk7. (Thomas Graves via vinodkv)

View File

@ -66,6 +66,12 @@ public class TestDelegationTokenRenewer {
private static Token<?> lastRenewed = null;
private static Token<?> tokenToRenewIn2Sec = null;
private static void reset() {
counter = 0;
lastRenewed = null;
tokenToRenewIn2Sec = null;
}
@Override
public boolean handleKind(Text kind) {
return KIND.equals(kind);
@ -124,6 +130,7 @@ public class TestDelegationTokenRenewer {
@Before
public void setUp() throws Exception {
Renewer.reset();
delegationTokenRenewer = new DelegationTokenRenewer();
delegationTokenRenewer.init(conf);
delegationTokenRenewer.start();