Skip to content

Commit b420dde

Browse files
author
Inigo Goiri
committed
YARN-10155. TestDelegationTokenRenewer.testTokenThreadTimeout fails in trunk. Contributed by Manikandan R.
1 parent 10461e0 commit b420dde

File tree

1 file changed

+10
-4
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ public void setUp() throws Exception {
220220
UserGroupInformation.setConfiguration(conf);
221221
eventQueue = new LinkedBlockingQueue<Event>();
222222
dispatcher = new AsyncDispatcher(eventQueue);
223+
dispatcher.init(conf);
223224
Renewer.reset();
224225
delegationTokenRenewer = createNewDelegationTokenRenewer(conf, counter);
225226
RMContext mockContext = mock(RMContext.class);
@@ -241,6 +242,11 @@ public void setUp() throws Exception {
241242

242243
@After
243244
public void tearDown() {
245+
try {
246+
dispatcher.close();
247+
} catch (IOException e) {
248+
LOG.debug("Unable to close the dispatcher. " + e);
249+
}
244250
delegationTokenRenewer.stop();
245251
}
246252

@@ -1711,10 +1717,10 @@ public void testTokenThreadTimeoutWithoutDelay() throws Exception {
17111717
"kerberos");
17121718
yarnConf.set(YarnConfiguration.RM_STORE,
17131719
MemoryRMStateStore.class.getName());
1714-
yarnConf.setTimeDuration(YarnConfiguration.RM_DT_RENEWER_THREAD_TIMEOUT, 5,
1720+
yarnConf.setTimeDuration(YarnConfiguration.RM_DT_RENEWER_THREAD_TIMEOUT, 3,
17151721
TimeUnit.SECONDS);
17161722
yarnConf.setTimeDuration(
1717-
YarnConfiguration.RM_DT_RENEWER_THREAD_RETRY_INTERVAL, 5,
1723+
YarnConfiguration.RM_DT_RENEWER_THREAD_RETRY_INTERVAL, 3,
17181724
TimeUnit.SECONDS);
17191725
yarnConf.setInt(YarnConfiguration.RM_DT_RENEWER_THREAD_RETRY_MAX_ATTEMPTS,
17201726
3);
@@ -1786,11 +1792,11 @@ protected void renewToken(final DelegationTokenToRenew dttr)
17861792
throws IOException {
17871793
try {
17881794
if (renewDelay.get()) {
1789-
// Delay for 4 times than the configured timeout
1795+
// Delay for 2 times than the configured timeout
17901796
Thread.sleep(config.getTimeDuration(
17911797
YarnConfiguration.RM_DT_RENEWER_THREAD_TIMEOUT,
17921798
YarnConfiguration.DEFAULT_RM_DT_RENEWER_THREAD_TIMEOUT,
1793-
TimeUnit.MILLISECONDS) * 4);
1799+
TimeUnit.MILLISECONDS) * 2);
17941800
}
17951801
super.renewToken(dttr);
17961802
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)