litiliu commented on code in PR #1175:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1175#discussion_r3774147894
##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/metrics/OperatorJosdkMetricsTest.java:
##########
@@ -156,17 +156,13 @@ public boolean isLastAttempt() {
assertEquals(1, getCount("Resource.Event"));
assertEquals(1, getCount("Resource.Event.ADDED"));
- operatorMetrics.cleanupDone(resourceId, metadata);
Review Comment:
Thanks for pointing this out. I agree that `cleanupDone` and the subsequent
terminal callback must be tested together.
I have pushed a new version.
The updated `testCleanupMetrics` now explicitly calls
`cleanupDone(resourceId, metadata)` followed by both
`reconciliationFinished(...)` and `reconciliationFailed(...)`, and asserts that
the metric registry and resource-metrics cache remain empty. The concurrent
tests also cover `cleanupDone` racing with each terminal callback.
I kept `testMetrics` focused on the normal callback path and restored its
positive `Reconciliation.finished` assertion. The original
`Reconciliation.cleanup` assertion cannot remain unchanged because the new
contract is for `cleanupDone` to unregister the entire per-resource group
immediately, so that counter no longer remains registered.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]