Skip to content

Commit 04401ce

Browse files
committed
pkg/monitortests/clusterversionoperator/legacycvomonitortests: Structured condition types
For reasons that are not clear to me, e065648 (switch operators to use interval, 2021-03-22, #26034) moved testOperatorState from using: condition := monitorapi.GetOperatorConditionStatus(event.Message) to using: strings.Contains(eventInterval.Message, fmt.Sprintf("%v", interestingCondition)) But that can lead to misidentification like [1]: : [bz-service-ca] clusteroperator/service-ca should not change condition/Available Run #0: Failed 1h24m4s { 1 unexpected clusteroperator state transitions during e2e test run Oct 05 16:28:56.647 - 1s W clusteroperator/service-ca condition/Progressing reason/_ManagedDeploymentsAvailable status/True Progressing: \nProgressing: service-ca does not have available replicas} That mentions "Available" as part of the reason, but the condition type itself is Progressing, so it should not contribute to a "should not change condition/Available" violation. There's a chance that e065648's move away from GetOperatorConditionStatus was because the function was broken at that time, but e00ec39 (Port cluster operator state intervals, 2023-09-19, #28262) recently adjusted its implementation, and pkg/monitortests/clusterversionoperator/operatorstateanalyzer/operator.go's intervalsFromEvents_OperatorStatus has used GetOperatorConditionStatus since the file was created in 4dfccfc (rebrand invariant tests as monitor tests, 2023-08-14, #28185) and has all the way back to when the intervalsFromEvents_OperatorStatus function was created in bbd9949 (create operator intervals from events, 2021-03-22, #26034, the same pull request as e065648). [1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/periodic-ci-openshift-release-master-ci-4.15-e2e-azure-ovn-upgrade/1709944908564926464
1 parent d5d3596 commit 04401ce

File tree

1 file changed

+7
-1
lines changed
  • pkg/monitortests/clusterversionoperator/legacycvomonitortests

1 file changed

+7
-1
lines changed

pkg/monitortests/clusterversionoperator/legacycvomonitortests/operators.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,13 @@ func testOperatorState(interestingCondition configv1.ClusterStatusConditionType,
276276
if eventInterval.From == eventInterval.To {
277277
continue
278278
}
279-
if !strings.Contains(eventInterval.Message, fmt.Sprintf("%v", interestingCondition)) {
279+
280+
condition := monitorapi.GetOperatorConditionStatus(eventInterval)
281+
if condition == nil {
282+
continue
283+
}
284+
285+
if condition.Type != interestingCondition {
280286
continue
281287
}
282288

0 commit comments

Comments
 (0)