Merge -c 1526735 from trunk to branch-2 to fix MAPREDUCE-5514. Fix TestRMContainerAllocator. Contributed by Zhijie Shen.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1526736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2013-09-26 23:03:25 +00:00
parent dfd64df5f1
commit 78045b7abc
3 changed files with 18 additions and 1 deletions

View File

@ -44,6 +44,8 @@ Release 2.3.0 - UNRELEASED
MAPREDUCE-5522. Incorrect oreder expected from JobQueueInfo (Jinghui Wang
via bobby)
MAPREDUCE-5514. Fix TestRMContainerAllocator. (Zhijie Shen via acmurthy)
Release 2.2.0 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -432,11 +432,21 @@ public class TestRMContainerAllocator {
}
private static class MyResourceManager extends MockRM {
private static long fakeClusterTimeStamp = System.currentTimeMillis();
public MyResourceManager(Configuration conf) {
super(conf);
}
@Override
public void serviceStart() throws Exception {
super.serviceStart();
// Ensure that the application attempt IDs for all the tests are the same
// The application attempt IDs will be used as the login user names
MyResourceManager.setClusterTimeStamp(fakeClusterTimeStamp);
}
@Override
protected Dispatcher createDispatcher() {
return new DrainDispatcher();

View File

@ -168,7 +168,12 @@ public class ResourceManager extends CompositeService implements Recoverable {
public static long getClusterTimeStamp() {
return clusterTimeStamp;
}
@VisibleForTesting
protected static void setClusterTimeStamp(long timestamp) {
clusterTimeStamp = timestamp;
}
@Override
protected void serviceInit(Configuration conf) throws Exception {
validateConfigs(conf);