From 7ed949600da1684098b89acdf46673cf5d9552f3 Mon Sep 17 00:00:00 2001 From: Chao Sun Date: Mon, 27 Sep 2021 13:56:22 -0700 Subject: [PATCH] HADOOP-17936. Fix test failure after reverting HADOOP-16878 (#3482) --- .../org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java index 7acb39c6e1..15466af7c1 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSCopyFromLocal.java @@ -27,8 +27,6 @@ import org.apache.hadoop.fs.contract.AbstractFSContract; import org.apache.hadoop.fs.contract.localfs.LocalFSContract; -import static org.apache.hadoop.test.LambdaTestUtils.intercept; - public class TestLocalFSCopyFromLocal extends AbstractContractCopyFromLocalTest { @Override protected AbstractFSContract createContract(Configuration conf) { @@ -37,14 +35,15 @@ protected AbstractFSContract createContract(Configuration conf) { @Test public void testDestinationFileIsToParentDirectory() throws Throwable { - describe("Source is a file and destination is its own parent directory"); + describe("Source is a file and destination is its own parent directory. " + + "Copying will cause the source file to be deleted."); File file = createTempFile("local"); Path dest = new Path(file.getParentFile().toURI()); Path src = new Path(file.toURI()); - intercept(PathOperationException.class, - () -> getFileSystem().copyFromLocalFile( true, true, src, dest)); + getFileSystem().copyFromLocalFile(true, true, src, dest); + assertPathDoesNotExist("Source found", src); } @Test