From 1f6dc4ee9a3ae38f7da2a768e07570f53002cdd2 Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Tue, 29 Aug 2017 09:52:24 -0500 Subject: [PATCH] YARN-5816. TestDelegationTokenRenewer#testCancelWithMultipleAppSubmissions is still flakey. Contributed by Robert Kanter --- .../security/TestDelegationTokenRenewer.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 9fb9d422a90..c708b921eea 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 @@ -1262,9 +1262,27 @@ public class TestDelegationTokenRenewer { Assert.assertFalse(Renewer.cancelled); finishAMAndWaitForComplete(app3, rm, nm1, am3, dttr); + GenericTestUtils.waitFor(new Supplier() { + @Override + public Boolean get() { + return !renewer.getAllTokens().containsKey(token1); + } + }, 10, 5000); Assert.assertFalse(renewer.getAllTokens().containsKey(token1)); Assert.assertTrue(dttr.referringAppIds.isEmpty()); + GenericTestUtils.waitFor(new Supplier() { + @Override + public Boolean get() { + return dttr.isTimerCancelled(); + } + }, 10, 5000); Assert.assertTrue(dttr.isTimerCancelled()); + GenericTestUtils.waitFor(new Supplier() { + @Override + public Boolean get() { + return Renewer.cancelled; + } + }, 10, 5000); Assert.assertTrue(Renewer.cancelled); // make sure the token also has been removed from appTokens