Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2876#discussion_r90249472
  
    --- Diff: 
flink-java/src/test/java/org/apache/flink/api/java/io/TextInputFormatTest.java 
---
    @@ -90,23 +92,23 @@ public void testSimpleRead() {
     
        @Test
        public void testNestedFileRead() {
    -           String[] dirs = new String[] {"tmp/first/", "tmp/second/"};
    -           List<String> expectedFiles = new ArrayList<>();
    -
                try {
    -                   for (String dir: dirs) {
    +                   String tmpDirPath = 
CommonTestUtils.createTempDirectory().getPath();
    +                   String[] dirs = new String[]{tmpDirPath + "/first/", 
tmpDirPath + "/second/"};
    +                   List<String> expectedFiles = new ArrayList<>();
    +                   for (String dir : dirs) {
                                // create input file
                                File tmpDir = new File(dir);
    -                           if (!tmpDir.exists()) {
    -                                   tmpDir.mkdirs();
    +                           if (!tmpDir.exists() && tmpDir.mkdirs()) {
    +                                   tmpDir.deleteOnExit();
                                }
     
    --- End diff --
    
    this section could be a bit cleaner imo:
    ```
    File parentDir = CommonTestUtils.createTempDirectory();
    String[] dirs = new String[]{"first", "second"};
    ...
        File tmpDir= new File(parentDir , dir);
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to