From c972498b74c9596970bd1c2e0b6d213257633c9b Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Wed, 3 Aug 2016 19:17:25 +0000 Subject: [PATCH] YARN-5462. TestNodeStatusUpdater.testNodeStatusUpdaterRetryAndNMShutdown fails intermittently. Contributed by Eric Badger (cherry picked from commit db646540f094077941b56ed681a4f3e5853f5b7f) --- .../yarn/server/nodemanager/TestNodeStatusUpdater.java | 5 +++++ 1 file changed, 5 insertions(+) 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 94f654a7a5c..3d72375fea5 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 @@ -557,6 +557,8 @@ public class TestNodeStatusUpdater { @Override protected void serviceStop() throws Exception { + // Make sure that all containers are started before starting shutdown + syncBarrier.await(10000, TimeUnit.MILLISECONDS); System.out.println("Called stooppppp"); super.serviceStop(); isStopped = true; @@ -1624,6 +1626,9 @@ public class TestNodeStatusUpdater { new File("start_file.txt"), port); try { + // Wait until we start stopping + syncBarrier.await(10000, TimeUnit.MILLISECONDS); + // Wait until we finish stopping syncBarrier.await(10000, TimeUnit.MILLISECONDS); } catch (Exception e) { }