Dennis-Mircea commented on code in PR #1221:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1221#discussion_r4402124037
##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/observer/ClusterHealthEvaluatorTest.java:
##########
@@ -263,6 +263,37 @@ public void
evaluateShouldMarkClusterUnhealthyWhenRestartThresholdHitInAverage()
assertClusterHealthIs(false);
}
+ @ParameterizedTest
+ @MethodSource("provideParametersEvaluateLegacyClusterHealthInfo")
+ public void evaluateShouldReevaluateLegacyClusterHealthInfo(
+ boolean legacyHealthy, int observedNumRestarts, boolean
expectedHealthy) {
+ configuration.set(OPERATOR_CLUSTER_HEALTH_CHECK_RESTARTS_WINDOW,
Duration.ofMinutes(5));
+ configuration.set(OPERATOR_CLUSTER_HEALTH_CHECK_RESTARTS_THRESHOLD,
100);
+ final var timeStamp = validInstant1.toEpochMilli();
+ // As stored by operators before 1.12 (FLINK-37769 replaced "healthy"
with
+ // "healthResult").
Review Comment:
Same here. The test method is already descriptive enough.
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/health/ClusterHealthInfo.java:
##########
@@ -31,6 +32,9 @@
@Experimental
@Data
@AllArgsConstructor
+// Health info stored by older operator versions may contain fields that no
longer exist, such as
+// "healthy" before FLINK-37769. Ignoring them lets the info be read and
re-evaluated.
Review Comment:
I think this is too much verbosity. We can drop this comment.
##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/health/ClusterHealthInfoTest.java:
##########
@@ -54,6 +55,26 @@ public void
deserializeWithOldVersionShouldDeserializeCorrectly() {
assertEquals("test-error",
clusterHealthInfoFromJson.getHealthResult().getError());
}
+ @Test
+ public void deserializeShouldIgnoreLegacyHealthyField() {
+ // As stored by operators before 1.12 (FLINK-37769 replaced "healthy"
with
+ // "healthResult").
Review Comment:
Same here.
--
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]