Repository: hadoop Updated Branches: refs/heads/branch-2 d0fc1cd0c -> edf9fd51f
YARN-4813. TestRMWebServicesDelegationTokenAuthentication.testDoAs fails intermittently (grepas via rkanter) (cherry picked from commit c83fe4491731c994a4867759d80db31d9c1cab60) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/edf9fd51 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/edf9fd51 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/edf9fd51 Branch: refs/heads/branch-2 Commit: edf9fd51fbe6821d402246c0d305ff535b1118f6 Parents: d0fc1cd Author: Robert Kanter <[email protected]> Authored: Fri Dec 1 12:18:13 2017 -0800 Committer: Robert Kanter <[email protected]> Committed: Fri Dec 1 12:21:18 2017 -0800 ---------------------------------------------------------------------- ...stRMWebServicesDelegationTokenAuthentication.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/edf9fd51/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java index b406fdb..41e56ae 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java @@ -76,6 +76,8 @@ public class TestRMWebServicesDelegationTokenAuthentication { TestRMWebServicesDelegationTokenAuthentication.class.getName() + "-root"); private static File httpSpnegoKeytabFile = new File( KerberosTestUtils.getKeytabFile()); + private static final String SUN_SECURITY_KRB5_RCACHE_KEY = + "sun.security.krb5.rcache"; private static String httpSpnegoPrincipal = KerberosTestUtils .getServerPrincipal(); @@ -83,7 +85,7 @@ public class TestRMWebServicesDelegationTokenAuthentication { private static boolean miniKDCStarted = false; private static MiniKdc testMiniKDC; private static MockRM rm; - + private static String sunSecurityKrb5RcacheValue; String delegationTokenHeader; @@ -98,6 +100,11 @@ public class TestRMWebServicesDelegationTokenAuthentication { @BeforeClass public static void setUp() { try { + // Disabling kerberos replay cache to avoid "Request is a replay" errors + // caused by frequent webservice calls + sunSecurityKrb5RcacheValue = + System.getProperty(SUN_SECURITY_KRB5_RCACHE_KEY); + System.setProperty(SUN_SECURITY_KRB5_RCACHE_KEY, "none"); testMiniKDC = new MiniKdc(MiniKdc.createConf(), testRootDir); setupKDC(); setupAndStartRM(); @@ -114,6 +121,12 @@ public class TestRMWebServicesDelegationTokenAuthentication { if (rm != null) { rm.stop(); } + if (sunSecurityKrb5RcacheValue == null) { + System.clearProperty(SUN_SECURITY_KRB5_RCACHE_KEY); + } else { + System.setProperty(SUN_SECURITY_KRB5_RCACHE_KEY, + sunSecurityKrb5RcacheValue); + } } @Parameterized.Parameters --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
