You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by zhangminglei <gi...@git.apache.org> on 2017/07/12 12:48:29 UTC

[GitHub] flink pull request #4311: [FLINK-7162] [test] Tests should not write outside...

GitHub user zhangminglei opened a pull request:

    https://github.com/apache/flink/pull/4311

    [FLINK-7162] [test] Tests should not write outside 'target' directory

    A few tests use ```Files.createTempDir()``` from Guava package, but do not set java.io.tmpdir system property. Thus the temp directory is created in unpredictable places and is not being cleaned up by ```mvn clean```.
    This was probably introduced in ```JobManagerStartupTest``` and then replicated in ```BlobUtilsTest```.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zhangminglei/flink flink-7162

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/4311.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4311
    
----
commit 159af161e6b3f5957731bc0ffb13e52afd1ef726
Author: zhangminglei <zm...@163.com>
Date:   2017-07-12T12:46:21Z

    [FLINK-7162] [test] Tests should not write outside 'target' directory

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4311: [FLINK-7162] [test] Tests should not write outside 'targe...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/4311
  
    merging.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4311: [FLINK-7162] [test] Tests should not write outside 'targe...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on the issue:

    https://github.com/apache/flink/pull/4311
  
    Thanks to zentol.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4311: [FLINK-7162] [test] Tests should not write outside 'targe...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on the issue:

    https://github.com/apache/flink/pull/4311
  
    PR have been updated. Please check again.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4311: [FLINK-7162] [test] Tests should not write outside 'targe...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on the issue:

    https://github.com/apache/flink/pull/4311
  
    Thanks @StephanEwen for generous review. All proposes have been addressed. PR updated again. Please helps to check :)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4311: [FLINK-7162] [test] Tests should not write outside...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/4311


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4311: [FLINK-7162] [test] Tests should not write outside...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4311#discussion_r127793602
  
    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsTest.java ---
    @@ -22,26 +22,29 @@
     import static org.junit.Assume.assumeTrue;
     import static org.mockito.Mockito.mock;
     
    -import com.google.common.io.Files;
    -
     import org.apache.flink.util.OperatingSystem;
     import org.junit.After;
     import org.junit.Before;
     import org.junit.Test;
    +import org.junit.Rule;
     
     import java.io.File;
     import java.io.IOException;
    +import org.junit.rules.TemporaryFolder;
     
     public class BlobUtilsTest {
     
     	private final static String CANNOT_CREATE_THIS = "cannot-create-this";
     
     	private File blobUtilsTestDirectory;
     
    +	@Rule
    +	public TemporaryFolder temporaryFolder = new TemporaryFolder();
    --- End diff --
    
    I think it is good practice to make such variables `final`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4311: [FLINK-7162] [test] Tests should not write outside...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4311#discussion_r127793846
  
    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsTest.java ---
    @@ -22,26 +22,29 @@
     import static org.junit.Assume.assumeTrue;
     import static org.mockito.Mockito.mock;
     
    -import com.google.common.io.Files;
    -
     import org.apache.flink.util.OperatingSystem;
     import org.junit.After;
     import org.junit.Before;
     import org.junit.Test;
    +import org.junit.Rule;
     
     import java.io.File;
     import java.io.IOException;
    +import org.junit.rules.TemporaryFolder;
     
     public class BlobUtilsTest {
     
     	private final static String CANNOT_CREATE_THIS = "cannot-create-this";
     
     	private File blobUtilsTestDirectory;
     
    +	@Rule
    +	public TemporaryFolder temporaryFolder = new TemporaryFolder();
    +
     	@Before
    -	public void before() {
    +	public void before() throws IOException {
     		// Prepare test directory
    -		blobUtilsTestDirectory = Files.createTempDir();
    +		blobUtilsTestDirectory = temporaryFolder.newFolder();
    --- End diff --
    
    Minor issue: Would be nice to move this after the OS check, keep the directory operations logically together.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4311: [FLINK-7162] [test] Tests should not write outside 'targe...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/4311
  
    Please use a junit `TemporaryFolder` instead.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #4311: [FLINK-7162] [test] Tests should not write outside 'targe...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on the issue:

    https://github.com/apache/flink/pull/4311
  
    Thanks, zentol. I will fix it using ```TemporaryFolder``` soon.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #4311: [FLINK-7162] [test] Tests should not write outside...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4311#discussion_r127793662
  
    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/jobmanager/JobManagerStartupTest.java ---
    @@ -51,11 +54,14 @@
     
     	private File blobStorageDirectory;
     
    +	@Rule
    +	public TemporaryFolder temporaryFolder = new TemporaryFolder();
    --- End diff --
    
    Same here...


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---