From b8d5df06f224a93b8fa6bee37d3f8499e78fe04a Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Fri, 29 Jan 2016 12:29:54 +0530 Subject: [PATCH] YARN-4543. Fix random test failure in TestNodeStatusUpdater.testStopReentrant. (Akihiro Suda via rohithsharmaks) (cherry picked from commit ac686668031ee9837deed3f3566f09f33c437870) --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../yarn/server/nodemanager/TestNodeStatusUpdater.java | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 865cd09503a..78e981caf81 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -115,6 +115,9 @@ Release 2.9.0 - UNRELEASED YARN-4519. Potential deadlock of CapacityScheduler between decrease container and assign containers. (Meng Ding via jianhe) + YARN-4543. Fix random test failure in TestNodeStatusUpdater.testStopReentrant + (Akihiro Suda via rohithsharmaks) + Release 2.8.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeStatusUpdater.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeStatusUpdater.java index a8066c131c1..9e6868deb6b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeStatusUpdater.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestNodeStatusUpdater.java @@ -1269,7 +1269,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