From aa3d6ed6ea1957b7bd3182dc6e2ae3b4f5277528 Mon Sep 17 00:00:00 2001 From: Jason Darrell Lowe Date: Fri, 25 Apr 2014 14:56:35 +0000 Subject: [PATCH] svn merge -c 1590046 FIXES: MAPREDUCE-5749. TestRMContainerAllocator#testReportedAppProgress Failed. Contributed by Jason Lowe git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1590047 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../hadoop/mapreduce/v2/app/TestRMContainerAllocator.java | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 530b4f4d617..32cce4887ea 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -53,6 +53,9 @@ Release 2.5.0 - UNRELEASED MAPREDUCE-5837. MRAppMaster fails when checking on uber mode. (wheat9) + MAPREDUCE-5749. TestRMContainerAllocator#testReportedAppProgress Failed + (jlowe) + Release 2.4.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java index 1785864ae6d..f1fbd1afde3 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java @@ -121,6 +121,9 @@ public class TestRMContainerAllocator { public void setup() { MyContainerAllocator.getJobUpdatedNodeEvents().clear(); MyContainerAllocator.getTaskAttemptKillEvents().clear(); + + // make each test create a fresh user to avoid leaking tokens between tests + UserGroupInformation.setLoginUser(null); } @After @@ -1516,17 +1519,15 @@ public class TestRMContainerAllocator { @Override protected void register() { ApplicationAttemptId attemptId = getContext().getApplicationAttemptId(); - UserGroupInformation ugi = - UserGroupInformation.createRemoteUser(attemptId.toString()); Token token = rm.getRMContext().getRMApps().get(attemptId.getApplicationId()) .getRMAppAttempt(attemptId).getAMRMToken(); try { + UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); ugi.addTokenIdentifier(token.decodeIdentifier()); } catch (IOException e) { throw new YarnRuntimeException(e); } - UserGroupInformation.setLoginUser(ugi); super.register(); }