From 8be1640bf66665ddea7ba3bed29651ae155a9514 Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Mon, 11 Jun 2018 19:25:56 -0700 Subject: [PATCH] YARN-8370. Some Node Manager tests fail on Windows due to improper path/file separator. Contributed by Anbang Hu. (cherry picked from commit 2b2f672022547e8c19658213ac5a4090bf5b6c72) --- .../yarn/server/nodemanager/TestLocalDirsHandlerService.java | 4 ++-- .../logaggregation/TestAppLogAggregatorImpl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLocalDirsHandlerService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLocalDirsHandlerService.java index e704c8fe36b..4183fbedfec 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLocalDirsHandlerService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLocalDirsHandlerService.java @@ -150,9 +150,9 @@ public class TestLocalDirsHandlerService { Assert .assertEquals(utilizationPerc, nm.getGoodLogDirsDiskUtilizationPerc()); - Assert.assertEquals(localDir2, + Assert.assertEquals(new Path(localDir2).toString(), dirSvc.getConfig().get(LocalDirsHandlerService.NM_GOOD_LOCAL_DIRS)); - Assert.assertEquals(logDir2, + Assert.assertEquals(new Path(logDir2).toString(), dirSvc.getConfig().get(LocalDirsHandlerService.NM_GOOD_LOG_DIRS)); Assert.assertEquals(localDir1 + "," + localDir2, dirSvc.getConfig().get(YarnConfiguration.NM_LOCAL_DIRS)); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestAppLogAggregatorImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestAppLogAggregatorImpl.java index 37ffd00cdf5..269dbab0760 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestAppLogAggregatorImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestAppLogAggregatorImpl.java @@ -316,7 +316,7 @@ public class TestAppLogAggregatorImpl { for(int i = 0; i < tasks.length; i++) { FileDeletionTask task = (FileDeletionTask) tasks[i]; for (Path path: task.getBaseDirs()) { - paths.add(path.toUri().getRawPath()); + paths.add(new File(path.toUri().getRawPath()).getAbsolutePath()); } } verifyFilesToDelete(expectedPathsForDeletion, paths);