From e0b14f26f5201a149218276469434df511697acc Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Mon, 29 Feb 2016 10:38:14 +0800 Subject: [PATCH] YARN-4566. Fix test failure in TestMiniYarnClusterNodeUtilization. (Takashi Ohnishi via rohithsharmaks) --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../yarn/server/TestMiniYarnClusterNodeUtilization.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index d2f871ac07..3c91fbd763 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -236,6 +236,9 @@ Release 2.9.0 - UNRELEASED YARN-4701. When task logs are not available, port 8041 is referenced instead of port 8042 (haibochen via rkanter) + YARN-4566. Fix test failure in TestMiniYarnClusterNodeUtilization. + (Takashi Ohnishi via rohithsharmaks) + Release 2.8.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java index cf83e673d9..49a82c8592 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestMiniYarnClusterNodeUtilization.java @@ -214,8 +214,10 @@ private void verifySimulatedUtilization() throws InterruptedException { // We check if the nodeUtilization is up to date for (int i=0; i<100; i++) { for (RMNode ni : rmContext.getRMNodes().values()) { - if (ni.getNodeUtilization().equals(nodeUtilization)) { - break; + if (ni.getNodeUtilization() != null) { + if (ni.getNodeUtilization().equals(nodeUtilization)) { + break; + } } } Thread.sleep(100);