From 4bcef1c6165cac164ff724bdb3327d36c49d302d Mon Sep 17 00:00:00 2001 From: Mingliang Liu Date: Fri, 11 Nov 2016 22:06:43 -0800 Subject: [PATCH] HADOOP-13813. TestDelegationTokenFetcher#testDelegationTokenWithoutRenewer is failing. Contributed by Mingliang Liu (cherry picked from commit fb3a5085e8057c79e0785e7e7bf7da031c3f3c12) --- .../apache/hadoop/tools/TestDelegationTokenFetcher.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java index d3433263611..75425a79504 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tools/TestDelegationTokenFetcher.java @@ -133,15 +133,16 @@ public class TestDelegationTokenFetcher { Iterator> itr = creds.getAllTokens().iterator(); // make sure we got back exactly the 1 token we expected assertTrue(itr.hasNext()); - assertNotNull("Token without renewer shouldn't be null", itr.next()); + final Token token = itr.next(); + assertNotNull("Token without renewer shouldn't be null", token); assertTrue(!itr.hasNext()); try { // Without renewer renewal of token should fail. DelegationTokenFetcher.main(new String[] { "--renew", tokenFile }); fail("Should have failed to renew"); } catch (AccessControlException e) { - GenericTestUtils.assertExceptionContains( - "tried to renew a token without a renewer", e); + GenericTestUtils.assertExceptionContains("tried to renew a token (" + + token.decodeIdentifier() + ") without a renewer", e); } } finally { cluster.shutdown();