From c202a10923a46a6e7f7f518e6e3dbb6545dbb971 Mon Sep 17 00:00:00 2001 From: Varun Saxena Date: Thu, 10 Nov 2016 11:41:34 +0530 Subject: [PATCH] YARN-5862. TestDiskFailures.testLocalDirsFailures failed (Yufei Gu via Varun Saxena) --- .../java/org/apache/hadoop/yarn/server/TestDiskFailures.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestDiskFailures.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestDiskFailures.java index c7e34d87dd..bf82ec54a3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestDiskFailures.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestDiskFailures.java @@ -244,7 +244,9 @@ private void verifyDisksHealth(boolean localORLogDirs, String expectedDirs, for (int i = 0; i < 10; i++) { Iterator iter = yarnCluster.getResourceManager().getRMContext() .getRMNodes().values().iterator(); - if ((iter.next().getState() != NodeState.UNHEALTHY) == isHealthy) { + // RMNode # might be zero because of timing related issue. + if (iter.hasNext() && + (iter.next().getState() != NodeState.UNHEALTHY) == isHealthy) { break; } // wait for the node health info to go to RM