HADOOP-11241. Fixed intermittent TestNMSimulator failure due to timing issue. Contributed by Varun Vasudev.

(cherry picked from commit 260ab6d5f4)
This commit is contained in:
Zhijie Shen 2014-10-31 18:02:39 -07:00
parent 5492370a4c
commit eb1718b71a
2 changed files with 13 additions and 0 deletions

View File

@ -665,6 +665,9 @@ Release 2.6.0 - UNRELEASED
HADOOP-11221. IdentityHashStore assumes System.identityHashCode() is
non-negative. (Jinghui Wang via szetszwo)
HADOOP-11241. Fixed intermittent TestNMSimulator failure due to timing issue.
(Varun Vasudev via zjshen)
Release 2.5.1 - 2014-09-05
INCOMPATIBLE CHANGES

View File

@ -54,6 +54,16 @@ public class TestNMSimulator {
node1.init("rack1/node1", GB * 10, 10, 0, 1000, rm);
node1.middleStep();
int numClusterNodes = rm.getResourceScheduler().getNumClusterNodes();
int cumulativeSleepTime = 0;
int sleepInterval = 100;
while(numClusterNodes != 1 && cumulativeSleepTime < 5000) {
Thread.sleep(sleepInterval);
cumulativeSleepTime = cumulativeSleepTime + sleepInterval;
numClusterNodes = rm.getResourceScheduler().getNumClusterNodes();
}
Assert.assertEquals(1, rm.getResourceScheduler().getNumClusterNodes());
Assert.assertEquals(GB * 10,
rm.getResourceScheduler().getRootQueueMetrics().getAvailableMB());