From 2ee294b1b13f6a8aa493ad3cf9a39d6df0506068 Mon Sep 17 00:00:00 2001 From: Chao Sun Date: Sat, 25 Sep 2021 09:29:33 -0700 Subject: [PATCH] Revert "MAPREDUCE-7303. Fix TestJobResourceUploader failures after HADOOP-16878. Contributed by Peter Bacsko." This reverts commit 7bc305db5d5a50127dd7780534d6d7d0b7c683d1. --- .../hadoop/mapreduce/TestJobResourceUploader.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploader.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploader.java index c49d77108b0..bbfe2fb03c3 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploader.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploader.java @@ -399,7 +399,6 @@ public class TestJobResourceUploader { Path expectedRemotePath) throws IOException, URISyntaxException { Path dstPath = new Path("hdfs://localhost:1234/home/hadoop/"); DistributedFileSystem fs = mock(DistributedFileSystem.class); - when(fs.makeQualified(any(Path.class))).thenReturn(dstPath); // make sure that FileUtils.copy() doesn't try to copy anything when(fs.mkdirs(any(Path.class))).thenReturn(false); when(fs.getUri()).thenReturn(dstPath.toUri()); @@ -408,7 +407,6 @@ public class TestJobResourceUploader { JobConf jConf = new JobConf(); Path originalPath = spy(path); FileSystem localFs = mock(FileSystem.class); - when(localFs.makeQualified(any(Path.class))).thenReturn(path); FileStatus fileStatus = mock(FileStatus.class); when(localFs.getFileStatus(any(Path.class))).thenReturn(fileStatus); when(fileStatus.isDirectory()).thenReturn(true); @@ -422,14 +420,8 @@ public class TestJobResourceUploader { originalPath, jConf, (short) 1); ArgumentCaptor pathCaptor = ArgumentCaptor.forClass(Path.class); - verify(fs, times(2)).makeQualified(pathCaptor.capture()); - List paths = pathCaptor.getAllValues(); - // first call is invoked on a path which was created by the test, - // but the second one is created in copyRemoteFiles() - Assert.assertEquals("Expected remote path", - expectedRemotePath, paths.get(0)); - Assert.assertEquals("Expected remote path", - expectedRemotePath, paths.get(1)); + verify(fs).makeQualified(pathCaptor.capture()); + Assert.assertEquals("Path", expectedRemotePath, pathCaptor.getValue()); } private void testErasureCodingSetting(boolean defaultBehavior)