[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092002#comment-16092002 ] ASF GitHub Bot commented on FLINK-7162: --- Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/4311 > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16091720#comment-16091720 ] ASF GitHub Bot commented on FLINK-7162: --- Github user zhangminglei commented on the issue: https://github.com/apache/flink/pull/4311 Thanks to zentol. > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16091614#comment-16091614 ] ASF GitHub Bot commented on FLINK-7162: --- Github user zentol commented on the issue: https://github.com/apache/flink/pull/4311 merging. > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16090948#comment-16090948 ] ASF GitHub Bot commented on FLINK-7162: --- 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 :) > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16090335#comment-16090335 ] ASF GitHub Bot commented on FLINK-7162: --- 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... > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16090333#comment-16090333 ] ASF GitHub Bot commented on FLINK-7162: --- 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. > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16090334#comment-16090334 ] ASF GitHub Bot commented on FLINK-7162: --- 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`. > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16085556#comment-16085556 ] ASF GitHub Bot commented on FLINK-7162: --- Github user zhangminglei commented on the issue: https://github.com/apache/flink/pull/4311 PR have been updated. Please check again. > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16085456#comment-16085456 ] ASF GitHub Bot commented on FLINK-7162: --- Github user zhangminglei commented on the issue: https://github.com/apache/flink/pull/4311 Thanks, zentol. I will fix it using ```TemporaryFolder``` soon. > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16084020#comment-16084020 ] ASF GitHub Bot commented on FLINK-7162: --- Github user zentol commented on the issue: https://github.com/apache/flink/pull/4311 Please use a junit `TemporaryFolder` instead. > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (FLINK-7162) Tests should not write outside 'target' directory.
[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16083922#comment-16083922 ] ASF GitHub Bot commented on FLINK-7162: --- 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: zhangmingleiDate: 2017-07-12T12:46:21Z [FLINK-7162] [test] Tests should not write outside 'target' directory > Tests should not write outside 'target' directory. > -- > > Key: FLINK-7162 > URL: https://issues.apache.org/jira/browse/FLINK-7162 > Project: Flink > Issue Type: Improvement > Components: Local Runtime >Reporter: mingleizhang >Assignee: mingleizhang > > 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}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)