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

    https://github.com/apache/flink/pull/5665#discussion_r173743909
  
    --- Diff: 
flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/WebFrontendITCase.java
 ---
    @@ -66,40 +73,44 @@
        private static final int NUM_TASK_MANAGERS = 2;
        private static final int NUM_SLOTS = 4;
     
    -   private static LocalFlinkMiniCluster cluster;
    +   private static final Configuration CLUSTER_CONFIGURATION = 
getClusterConfiguration();
     
    -   private static int port = -1;
    +   @ClassRule
    +   public static final MiniClusterResource CLUSTER = new 
MiniClusterResource(
    +           new MiniClusterResource.MiniClusterResourceConfiguration(
    +                   CLUSTER_CONFIGURATION,
    +                   NUM_TASK_MANAGERS,
    +                   NUM_SLOTS),
    +           true
    +   );
     
    -   @BeforeClass
    -   public static void initialize() throws Exception {
    +   private static Configuration getClusterConfiguration() {
                Configuration config = new Configuration();
    -           config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 
NUM_TASK_MANAGERS);
    -           config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 
NUM_SLOTS);
    -           config.setLong(TaskManagerOptions.MANAGED_MEMORY_SIZE, 12L);
    -           config.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true);
    -
    -           File logDir = File.createTempFile("TestBaseUtils-logdir", null);
    -           assertTrue("Unable to delete temp file", logDir.delete());
    -           assertTrue("Unable to create temp directory", logDir.mkdir());
    -           File logFile = new File(logDir, "jobmanager.log");
    -           File outFile = new File(logDir, "jobmanager.out");
    -
    -           Files.createFile(logFile.toPath());
    -           Files.createFile(outFile.toPath());
    +           try {
    +                   File logDir = 
File.createTempFile("TestBaseUtils-logdir", null);
    --- End diff --
    
    Making it a rule is a bit tricky since you end up with a dependency between 
rules as the cluster is also one.


---

Reply via email to