You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/02 17:04:00 UTC

[jira] [Commented] (FLINK-9125) MiniClusterResource should set CoreOptions.TMP_DIRS

    [ https://issues.apache.org/jira/browse/FLINK-9125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461315#comment-16461315 ] 

ASF GitHub Bot commented on FLINK-9125:
---------------------------------------

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

    https://github.com/apache/flink/pull/5933#discussion_r184928993
  
    --- Diff: flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/MiniClusterResource.java ---
    @@ -137,6 +142,7 @@ public int getWebUIPort() {
     
     	@Override
     	public void before() throws Exception {
    +		temporaryFolder.create();
    --- End diff --
    
    could be necessary if the `@Rule` annotation doesn't work in arbitrary (i..e. non-test) classes. Then we have to manage it manually, with `create()` and `before()`.


> 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)