From issues-return-157852-archive-asf-public=cust-asf.ponee.io@flink.apache.org Mon Mar 12 11:09:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 47BD918064D for ; Mon, 12 Mar 2018 11:09:04 +0100 (CET) Received: (qmail 10319 invoked by uid 500); 12 Mar 2018 10:09:03 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 10306 invoked by uid 99); 12 Mar 2018 10:09:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Mar 2018 10:09:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id CA993C11EE for ; Mon, 12 Mar 2018 10:09:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id BSx7GRihgY9s for ; Mon, 12 Mar 2018 10:09:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 481E05F1ED for ; Mon, 12 Mar 2018 10:09:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7D6A7E002F for ; Mon, 12 Mar 2018 10:09:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3658F21468 for ; Mon, 12 Mar 2018 10:09:00 +0000 (UTC) Date: Mon, 12 Mar 2018 10:09:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-8703) Migrate tests from LocalFlinkMiniCluster to MiniClusterResource MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-8703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16395021#comment-16395021 ] ASF GitHub Bot commented on FLINK-8703: --------------------------------------- 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. > Migrate tests from LocalFlinkMiniCluster to MiniClusterResource > --------------------------------------------------------------- > > Key: FLINK-8703 > URL: https://issues.apache.org/jira/browse/FLINK-8703 > Project: Flink > Issue Type: Sub-task > Components: Tests > Reporter: Aljoscha Krettek > Assignee: Chesnay Schepler > Priority: Blocker > Fix For: 1.5.0 > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)