flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7933) Test instability PrometheusReporterTest
Date Fri, 27 Oct 2017 09:02:00 GMT

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

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

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

    https://github.com/apache/flink/pull/4908#discussion_r147357745
  
    --- Diff: flink-metrics/flink-metrics-prometheus/src/test/java/org/apache/flink/metrics/prometheus/PrometheusReporterTaskScopeTest.java
---
    @@ -72,10 +72,30 @@
     	private final AbstractID taskAttemptId2 = new AbstractID();
     	private final String[] labelValues2 = {jobId.toString(), taskId2.toString(), taskAttemptId2.toString(),
TASK_MANAGER_HOST, TASK_NAME, "" + ATTEMPT_NUMBER, JOB_NAME, TASK_MANAGER_ID, "" + SUBTASK_INDEX_2};
     
    -	private final TaskManagerMetricGroup tmMetricGroup = new TaskManagerMetricGroup(registry,
TASK_MANAGER_HOST, TASK_MANAGER_ID);
    -	private final TaskManagerJobMetricGroup tmJobMetricGroup = new TaskManagerJobMetricGroup(registry,
tmMetricGroup, jobId, JOB_NAME);
    -	private final TaskMetricGroup taskMetricGroup1 = new TaskMetricGroup(registry, tmJobMetricGroup,
taskId1, taskAttemptId1, TASK_NAME, SUBTASK_INDEX_1, ATTEMPT_NUMBER);
    -	private final TaskMetricGroup taskMetricGroup2 = new TaskMetricGroup(registry, tmJobMetricGroup,
taskId2, taskAttemptId2, TASK_NAME, SUBTASK_INDEX_2, ATTEMPT_NUMBER);
    +	private TaskMetricGroup taskMetricGroup1;
    +	private TaskMetricGroup taskMetricGroup2;
    +
    +	private MetricRegistry registry;
    +	private int port;
    +
    +	@Before
    +	public void setupReporter() {
    +		registry = new MetricRegistry(MetricRegistryConfiguration.fromConfiguration(createConfigWithOneReporter("test1",
"9400-9500")));
    +		PrometheusReporter reporter = (PrometheusReporter) registry.getReporters().get(0);
    +		port = reporter.getPort();
    +
    +		TaskManagerMetricGroup tmMetricGroup = new TaskManagerMetricGroup(registry, TASK_MANAGER_HOST,
TASK_MANAGER_ID);
    +		TaskManagerJobMetricGroup tmJobMetricGroup = new TaskManagerJobMetricGroup(registry,
tmMetricGroup, jobId, JOB_NAME);
    +		taskMetricGroup1 = new TaskMetricGroup(registry, tmJobMetricGroup, taskId1, taskAttemptId1,
TASK_NAME, SUBTASK_INDEX_1, ATTEMPT_NUMBER);
    +		taskMetricGroup2 = new TaskMetricGroup(registry, tmJobMetricGroup, taskId2, taskAttemptId2,
TASK_NAME, SUBTASK_INDEX_2, ATTEMPT_NUMBER);
    +	}
    +
    +	@After
    +	public void shutdownRegistry() {
    +		if (registry != null) {
    +			registry.shutdown();
    --- End diff --
    
    you are not closing the reporter here. Isn't this a root cause of the test instability?


> Test instability PrometheusReporterTest
> ---------------------------------------
>
>                 Key: FLINK-7933
>                 URL: https://issues.apache.org/jira/browse/FLINK-7933
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics, Tests
>    Affects Versions: 1.4.0
>            Reporter: Kostas Kloudas
>            Assignee: Chesnay Schepler
>            Priority: Critical
>              Labels: test-stability
>
> Travis log: https://travis-ci.org/kl0u/flink/jobs/293220196



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message