Revert "MAPREDUCE-7303. Fix TestJobResourceUploader failures after HADOOP-16878. Contributed by Peter Bacsko."

This reverts commit c40f0f1eb34df64449472f698d1d68355f109e9b.
This commit is contained in:
Wei-Chiu Chuang 2021-06-01 16:37:10 +08:00
parent b2d1449986
commit 1067920757
No known key found for this signature in database
GPG Key ID: B362E1C021854B9D

View File

@ -399,7 +399,6 @@ private void testOriginalPathWithTrailingSlash(Path path,
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 @@ private void testOriginalPathWithTrailingSlash(Path path,
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 @@ private void testOriginalPathWithTrailingSlash(Path path,
originalPath, jConf, (short) 1);
ArgumentCaptor<Path> pathCaptor = ArgumentCaptor.forClass(Path.class);
verify(fs, times(2)).makeQualified(pathCaptor.capture());
List<Path> 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)