YARN-4543. Fix random test failure in TestNodeStatusUpdater.testStopReentrant. (Akihiro Suda via rohithsharmaks)

(cherry picked from commit ac68666803)
This commit is contained in:
Jason Lowe 2016-10-03 16:06:17 +00:00
parent 3a89a8814f
commit 515727f46f
1 changed files with 8 additions and 1 deletions

View File

@ -1276,7 +1276,14 @@ public class TestNodeStatusUpdater {
}
Assert.assertEquals(STATE.STOPPED, nm.getServiceState());
Assert.assertEquals(numCleanups.get(), 1);
// It further takes a while after NM reached the STOPPED state.
waitCount = 0;
while (numCleanups.get() == 0 && waitCount++ != 20) {
LOG.info("Waiting for NM shutdown..");
Thread.sleep(1000);
}
Assert.assertEquals(1, numCleanups.get());
}
@Test