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:
parent
dfd64df5f1
commit
78045b7abc
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue