[
https://issues.apache.org/jira/browse/FLINK-9125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16458122#comment-16458122
]
ASF GitHub Bot commented on FLINK-9125:
---------------------------------------
Github user GJL commented on a diff in the pull request:
https://github.com/apache/flink/pull/5933#discussion_r184892264
--- Diff:
flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/MiniClusterResource.java
---
@@ -149,6 +155,7 @@ public void before() throws Exception {
@Override
public void after() {
+ temporaryFolder.delete();
--- End diff --
No need to call this explicitly:
```
/**
* Delete all files and folders under the temporary folder. Usually not
* called directly, since it is automatically applied by the {@link
Rule}
*/
public void delete() {
if (folder != null) {
recursiveDelete(folder);
}
}
```
> MiniClusterResource should set CoreOptions.TMP_DIRS
> ---------------------------------------------------
>
> Key: FLINK-9125
> URL: https://issues.apache.org/jira/browse/FLINK-9125
> Project: Flink
> Issue Type: Improvement
> Components: Tests
> Affects Versions: 1.5.0
> Reporter: Chesnay Schepler
> Assignee: vinoyang
> Priority: Major
>
> We've frequently seen test stability issues when creating temporary file that
> use hard-coded paths, like {{/tmp}}, and generally tried to instead use
> {{TemporaryFolders}} instead.
> The {{CoreOptions.TMP_DIRS}} option is used by some components to determine
> where temporary files should be placed. By default this points to
> {{System.getProperty("java.io.tmpdir")}}, which usually points to {{/tmp}}.
> This property is rarely set explicitly by tests, which leads to failures such
> as this: https://travis-ci.org/apache/flink/jobs/361515791
> {code}
> org.apache.flink.test.api.java.operators.lambdas.JoinITCase Time elapsed:
> 3.025 sec <<< ERROR!
> java.io.IOException: Could not create root directory for local recovery:
> /tmp/localState
> at
> org.apache.flink.runtime.state.TaskExecutorLocalStateStoresManager.<init>(TaskExecutorLocalStateStoresManager.java:89)
> at
> org.apache.flink.runtime.taskexecutor.TaskManagerServices.fromConfiguration(TaskManagerServices.java:284)
> at
> org.apache.flink.runtime.taskexecutor.TaskManagerRunner.startTaskManager(TaskManagerRunner.java:303)
> at
> org.apache.flink.runtime.minicluster.MiniCluster.startTaskManagers(MiniCluster.java:738)
> at
> org.apache.flink.runtime.minicluster.MiniCluster.start(MiniCluster.java:306)
> at
> org.apache.flink.test.util.MiniClusterResource.startMiniCluster(MiniClusterResource.java:217)
> at
> org.apache.flink.test.util.MiniClusterResource.startJobExecutorService(MiniClusterResource.java:171)
> at
> org.apache.flink.test.util.MiniClusterResource.before(MiniClusterResource.java:121)
> at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
> at org.junit.rules.RunRules.evaluate(RunRules.java:20)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
> at
> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
> at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> {code}
> It would be nice if the MiniClusterResource inherently contains a
> {{TemporaryFolder}} which is used to configure {{CoreOptions.TMP_DIRS}} as
> well as other tmp dir options.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)