[ https://issues.apache.org/jira/browse/FLINK-7162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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)