From bf6c31f57245c573f1b7492082118fd6c968d66e Mon Sep 17 00:00:00 2001 From: teamconfx Date: Fri, 15 Sep 2023 03:17:06 +0800 Subject: [PATCH] add a new test regarding the issue --- .../TestZKDelegationTokenSecretManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestZKDelegationTokenSecretManager.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestZKDelegationTokenSecretManager.java index e92a25ea0ed8f..469d87ab30c6f 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestZKDelegationTokenSecretManager.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/TestZKDelegationTokenSecretManager.java @@ -106,10 +106,22 @@ protected Configuration getSecretConf(String connectString) { @SuppressWarnings("unchecked") @Test public void testMultiNodeOperations() throws Exception { + testMultiNodeOperationsImpl(false); + } + + @Test + public void testMultiNodeOperationsWithZeroRetry() throws Exception { + testMultiNodeOperationsImpl(true); + } + + public void testMultiNodeOperationsImpl(boolean setZeroRetry) throws Exception { for (int i = 0; i < TEST_RETRIES; i++) { DelegationTokenManager tm1, tm2 = null; String connectString = zkServer.getConnectString(); Configuration conf = getSecretConf(connectString); + if (setZeroRetry) { + conf.setInt(ZKDelegationTokenSecretManager.ZK_DTSM_ZK_NUM_RETRIES, 0); + } tm1 = new DelegationTokenManager(conf, new Text("bla")); tm1.init(); tm2 = new DelegationTokenManager(conf, new Text("bla"));