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