Skip to content

Commit 11c0724

Browse files
author
slfan1989
committed
YARN-11253. Add Junit Test.
1 parent f4f4cef commit 11c0724

File tree

1 file changed

+7
-3
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager

1 file changed

+7
-3
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestClientRMTokens.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ public void testDelegationToken() throws Exception {
124124
long initialInterval = 10000l;
125125
long maxLifetime= 20000l;
126126
long renewInterval = 10000l;
127+
long delegationTokenRemoverScanInterval =
128+
conf.getLong(YarnConfiguration.RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_KEY,
129+
YarnConfiguration.RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_DEFAULT);
127130

128131
RMDelegationTokenSecretManager rmDtSecretManager = createRMDelegationTokenSecretManager(
129-
initialInterval, maxLifetime, renewInterval);
132+
initialInterval, maxLifetime, renewInterval, delegationTokenRemoverScanInterval);
130133
rmDtSecretManager.startThreads();
131134
LOG.info("Creating DelegationTokenSecretManager with initialInterval: "
132135
+ initialInterval + ", maxLifetime: " + maxLifetime
@@ -574,7 +577,8 @@ private static ResourceScheduler createMockScheduler(Configuration conf) {
574577

575578
private static RMDelegationTokenSecretManager
576579
createRMDelegationTokenSecretManager(long secretKeyInterval,
577-
long tokenMaxLifetime, long tokenRenewInterval) {
580+
long tokenMaxLifetime, long tokenRenewInterval,
581+
long delegationTokenRemoverScanInterval) {
578582
ResourceManager rm = mock(ResourceManager.class);
579583
RMContext rmContext = mock(RMContext.class);
580584
when(rmContext.getStateStore()).thenReturn(new NullRMStateStore());
@@ -583,7 +587,7 @@ private static ResourceScheduler createMockScheduler(Configuration conf) {
583587

584588
RMDelegationTokenSecretManager rmDtSecretManager =
585589
new RMDelegationTokenSecretManager(secretKeyInterval, tokenMaxLifetime,
586-
tokenRenewInterval, 3600000, rmContext);
590+
tokenRenewInterval, delegationTokenRemoverScanInterval, rmContext);
587591
return rmDtSecretManager;
588592
}
589593
}

0 commit comments

Comments
 (0)