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

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

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

    https://github.com/apache/flink/pull/5780#discussion_r181533944
  
    --- Diff: 
flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/util/MiniClusterResource.java
 ---
    @@ -117,6 +138,7 @@ public TestEnvironment getTestEnvironment() {
     
        @Override
        public void before() throws Exception {
    +           miniClusterResourceConfiguration = 
Preconditions.checkNotNull(miniClusterResourceConfigurationSupplier.get());
    --- End diff --
    
    That's not "easy", it doesn't even solve the issue.
    
    The contained `TemporaryFolder` would only be available after the 
construction of the `MiniClusterResource`, the folder is however necessary to 
create the configuration of the `MiniClusterResource`. Naturally we would like 
both of these to be `Rules`, but that's not possible unless the configuration 
is generated lazily, as i propose in the PR. Due to the `RuleChain` at the time 
that `MiniClusterResource#before` is called we can already access the 
`TemporaryFolder`.
    
    The alternative is for the `TemporaryFolder` to be setup in a 
`@BeforeClass` method which is then used in the for the configuration. That 
would totally works, but it is really unfortunate as the setting of temporary 
paths is rather common and required for virtually all tests that use file-based 
state backends.
    
    I agree that my proposal is quite hacky, but the question we have to ask is 
whether we prefer more complexity in the test vs the `MiniClusterResource`, 
where i would prefer the latter.


> Port ClassLoaderITCase to flip6
> -------------------------------
>
>                 Key: FLINK-8955
>                 URL: https://issues.apache.org/jira/browse/FLINK-8955
>             Project: Flink
>          Issue Type: Improvement
>          Components: Tests
>    Affects Versions: 1.5.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Blocker
>             Fix For: 1.5.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to