[flink] add e2e coverage for task/operator-scope metrics - #24742
Open
barryib wants to merge 1 commit into
Open
Conversation
3 tasks
…etrics test_e2e.py previously only exercised jobmanager/taskmanager JVM-level metrics, since no Flink job was ever running. Submit the bundled StateMachineExample.jar so task- and operator-scope metrics (numRecordsIn, watermarks, etc.) get real coverage, including tag extraction against genuine Flink-emitted label values instead of the hand-written unit test fixture. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
barryib
force-pushed
the
test/flink-e2e-task-operator-metrics
branch
from
July 30, 2026 23:25
2d631fe to
cb69500
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
numRecordsIn, watermarks, etc.) — only JVM-level metrics.StateMachineExample.jar(self-contained, no external deps, runs continuously) as part ofdd_environmentsetup, gated by aWaitForpoll of the taskmanager's/metricsendpoint instead of a blindsleep.test_e2e_discovery(nottest_e2e_jobmanager_metrics— task/operator metrics are only exposed via the TaskManager's own endpoint) with presence assertions for representative task and operator metrics, now exercising real tag extraction (job_name,task_name,operator_name,subtask_index) against genuine Flink-emitted data instead of only the hand-writtentests/fixtures/metrics.txtfixture used by unit tests.Stacked on #24740 (counter/gauge fix) since that's what makes
flink.task.numRecordsIn/flink.operator.numRecordsInsubmit correctly. This diff will include #24740's commits until that PR merges and this branch is rebased ontomaster— the actual new content here is onlyflink/tests/conftest.pyandflink/tests/test_e2e.py.Note: this does not assert
metric_type=MONOTONIC_COUNTin e2e — the real Agent'smonotonic_countsender computes its delta internally and the e2e replay JSON reports the result asgaugeregardless, which is why no e2e test in this repo asserts that type. Counter-vs-gauge submission type is already covered by the unit test in #24740.Test plan
ddev env test flink py3.13-1.19— all e2e tests pass (test_e2e_jobmanager_metrics,test_e2e_discovery,test_e2e_discovery_all_candidates)--recreateto check for flakiness in the newWaitForgate — passed cleanly twiceddev test --fmt/ lint — clean🤖 Generated with Claude Code