diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index cd3cc4d3981..45e2a20d5b8 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -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) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestDelegationTokenRenewer.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestDelegationTokenRenewer.java index 4184465451e..1c3614e46df 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestDelegationTokenRenewer.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestDelegationTokenRenewer.java @@ -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(); @@ -367,7 +374,7 @@ public class TestDelegationTokenRenewer { Credentials ts = new Credentials(); MyToken token1 = dfs.getDelegationToken(new Text("user1")); - + //to cause this one to be set for renew in 2 secs Renewer.tokenToRenewIn2Sec = token1; LOG.info("token="+token1+" should be renewed for 2 secs");