[
https://issues.apache.org/jira/browse/FLINK-40791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18128372#comment-18128372
]
Sangkyoon Nam commented on FLINK-40791:
---------------------------------------
[~martijnvisser], I'd like to take this. The reporter exports counter deltas
({{AggregationTemporality.DELTA}}, {{count - previousCount}}), so the two
reports in {{testCounterDelta}} carry {{1234}} and {{25}}, but the second check
still expects {{1234}}. {{eventuallyConsumeJson}} asserts only on the last line
of the collector file, and the collector buffers that file, so the second check
passes if it still sees the first report. If the second report is already
there, it retries the wrong expectation until the two-minute timeout, which
matches the {{expected: 1234 but was: 25}} failure after 121.9 s.
On master ({{bbf37d09946}}), a 5 s wait before the second check reproduced it:
the test failed after 126.8 s with the same message. With the second
expectation changed to {{25}}, it passed once with the wait and three times
without it, and all six tests in {{OpenTelemetryMetricReporterITCase}} passed.
The one-line fix is ready; could you assign this to me so I can open the PR?
> OpenTelemetryMetricReporterITCase.testCounterDelta fails with expected 1234
> but was 25
> --------------------------------------------------------------------------------------
>
> Key: FLINK-40791
> URL: https://issues.apache.org/jira/browse/FLINK-40791
> Project: Flink
> Issue Type: Bug
> Components: Runtime / Metrics
> Affects Versions: 2.3.1, 2.4.0
> Reporter: Martijn Visser
> Priority: Major
>
> https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=79306&view=logs&j=2e8cb2f7-b2d3-5c62-9c05-cd756d33a819
> (release-2.3 push, 2026-09-21)
> {code}
> [ERROR]
> org.apache.flink.metrics.otel.OpenTelemetryMetricReporterITCase.testCounterDelta
> -- Time elapsed: 121.9 s <<< ERROR!
> org.apache.flink.metrics.otel.OpenTelemetryTestBase$ConsumeDataLogException:
> org.opentest4j.AssertionFailedError:
> expected: 1234
> but was: 25
> at
> org.apache.flink.metrics.otel.OpenTelemetryTestBase.lambda$eventuallyConsumeJson$1(OpenTelemetryTestBase.java:118)
> at
> org.apache.flink.metrics.otel.OpenTelemetryMetricReporterITCase.testCounterDelta(OpenTelemetryMetricReporterITCase.java:200)
> Caused by: org.opentest4j.AssertionFailedError:
> expected: 1234
> but was: 25
> at
> org.apache.flink.metrics.otel.OpenTelemetryMetricReporterITCase.lambda$testCounterDelta$5(OpenTelemetryMetricReporterITCase.java:213)
> {code}
> Line 213 is the assertion in the second {{eventuallyConsumeJson}}, after
> {{counter.inc(25)}} and the second {{report()}}; the first one passed. The
> push did not touch the test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)