This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch branch-4.7
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/branch-4.7 by this push:
new faca989 ISSUE #1415: [DLOG]
org.apache.distributedlog.fs.TestDLFileSystem fails on CI
faca989 is described below
commit faca9894600b4326c7a53486bb09ca7a5a6bf2e6
Author: Enrico Olivelli <[email protected]>
AuthorDate: Tue May 22 19:09:08 2018 -0700
ISSUE #1415: [DLOG] org.apache.distributedlog.fs.TestDLFileSystem fails on
CI
Use a generated tempDir for DL FS tests instead of using an hard coded /tmp
path
Fix for #1415
Author: Enrico Olivelli <[email protected]>
Reviewers: Jia Zhai <None>, Sijie Guo <[email protected]>
This closes #1417 from eolivelli/fix/no-tmpdir-fsdl, closes #1415
(cherry picked from commit 206443dff3fde2ca2eaa355b9799ecc6d5100988)
Signed-off-by: Sijie Guo <[email protected]>
---
.../test/java/org/apache/distributedlog/fs/TestDLFileSystem.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git
a/stream/distributedlog/io/dlfs/src/test/java/org/apache/distributedlog/fs/TestDLFileSystem.java
b/stream/distributedlog/io/dlfs/src/test/java/org/apache/distributedlog/fs/TestDLFileSystem.java
index 70d8a21..bab3804 100644
---
a/stream/distributedlog/io/dlfs/src/test/java/org/apache/distributedlog/fs/TestDLFileSystem.java
+++
b/stream/distributedlog/io/dlfs/src/test/java/org/apache/distributedlog/fs/TestDLFileSystem.java
@@ -33,7 +33,9 @@ import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.Path;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
/**
* Integration test for {@link DLFileSystem}.
@@ -41,6 +43,9 @@ import org.junit.Test;
@Slf4j
public class TestDLFileSystem extends TestDLFSBase {
+ @Rule
+ public TemporaryFolder tmpDir = new TemporaryFolder();
+
@Test(expected = FileNotFoundException.class)
public void testOpenFileNotFound() throws Exception {
Path path = new Path("not-found-file");
@@ -61,8 +66,7 @@ public class TestDLFileSystem extends TestDLFSBase {
}
assertTrue(fs.exists(path));
- File tempFile = new File("/tmp/" + runtime.getMethodName());
- tempFile.delete();
+ File tempFile = tmpDir.newFile();
Path localDst = new Path(tempFile.getPath());
// copy the file
fs.copyToLocalFile(path, localDst);
--
To stop receiving notification emails like this one, please contact
[email protected].