From 51a34a4288926007b7e9f731adc99bb3c50f57c0 Mon Sep 17 00:00:00 2001 From: Forrest Babcock <36795216+neisw@users.noreply.github.com> Date: Fri, 25 Apr 2025 16:25:50 -0400 Subject: [PATCH 1/2] Revert "Revert "TRT-2049: check for any watch requests"" --- .../handle_operator_watch_count_tracking.go | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/pkg/monitortests/kubeapiserver/auditloganalyzer/handle_operator_watch_count_tracking.go b/pkg/monitortests/kubeapiserver/auditloganalyzer/handle_operator_watch_count_tracking.go index 99c0ee957637..d54d95bfbef6 100644 --- a/pkg/monitortests/kubeapiserver/auditloganalyzer/handle_operator_watch_count_tracking.go +++ b/pkg/monitortests/kubeapiserver/auditloganalyzer/handle_operator_watch_count_tracking.go @@ -141,6 +141,7 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) { ret := []*junitapi.JUnitTestCase{} testName := "[sig-arch][Late] operators should not create watch channels very often" + testMinRequestsName := "[sig-arch][Late] operators should have watch channel requests" oc := exutil.NewCLIWithoutNamespace("operator-watch") infra, err := oc.AdminConfigClient().ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{}) if err != nil { @@ -153,6 +154,15 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) { }, ) + ret = append(ret, &junitapi.JUnitTestCase{ + Name: testMinRequestsName, + FailureOutput: &junitapi.FailureOutput{ + Message: err.Error(), + Output: err.Error(), + }, + }, + ) + return ret, nil } @@ -381,6 +391,9 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) { return []*junitapi.JUnitTestCase{{ Name: testName, SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported single node platform type: %v", infra.Spec.PlatformSpec.Type)}, + }, { + Name: testMinRequestsName, + SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported single node platform type: %v", infra.Spec.PlatformSpec.Type)}, }}, nil } @@ -390,6 +403,9 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) { return []*junitapi.JUnitTestCase{{ Name: testName, SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported platform type: %v", infra.Spec.PlatformSpec.Type)}, + }, { + Name: testMinRequestsName, + SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported platform type: %v", infra.Spec.PlatformSpec.Type)}, }}, nil } upperBound = upperBounds[infra.Spec.PlatformSpec.Type] @@ -397,6 +413,23 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) { watchRequestCounts := s.SummarizeWatchCountRequests() + if len(watchRequestCounts) > 0 { + ret = append(ret, + &junitapi.JUnitTestCase{ + Name: testMinRequestsName, + }, + ) + } else { + ret = append(ret, + &junitapi.JUnitTestCase{ + Name: testMinRequestsName, + FailureOutput: &junitapi.FailureOutput{ + Message: "Expected at least one watch request count to be present", + }, + }, + ) + } + operatorBoundExceeded := []string{} for _, item := range watchRequestCounts { operator := strings.Split(item.Operator, ":")[3] From 0aa6dd09dcfe3f65910c706ffde7d7dc186097e7 Mon Sep 17 00:00:00 2001 From: Forrest Babcock Date: Fri, 25 Apr 2025 16:51:58 -0400 Subject: [PATCH 2/2] TRT-2049: check topology flake failures --- .../handle_operator_watch_count_tracking.go | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/pkg/monitortests/kubeapiserver/auditloganalyzer/handle_operator_watch_count_tracking.go b/pkg/monitortests/kubeapiserver/auditloganalyzer/handle_operator_watch_count_tracking.go index d54d95bfbef6..0c97c0b07bb8 100644 --- a/pkg/monitortests/kubeapiserver/auditloganalyzer/handle_operator_watch_count_tracking.go +++ b/pkg/monitortests/kubeapiserver/auditloganalyzer/handle_operator_watch_count_tracking.go @@ -386,7 +386,18 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) { } var upperBound platformUpperBound - if infra.Status.ControlPlaneTopology == configv1.SingleReplicaTopologyMode { + + switch infra.Status.ControlPlaneTopology { + case configv1.ExternalTopologyMode: + return []*junitapi.JUnitTestCase{{ + Name: testName, + SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported topology: %v", infra.Status.ControlPlaneTopology)}, + }, { + Name: testMinRequestsName, + SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported topology: %v", infra.Status.ControlPlaneTopology)}, + }}, nil + + case configv1.SingleReplicaTopologyMode: if _, exists := upperBoundsSingleNode[infra.Spec.PlatformSpec.Type]; !exists { return []*junitapi.JUnitTestCase{{ Name: testName, @@ -398,7 +409,8 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) { } upperBound = upperBoundsSingleNode[infra.Spec.PlatformSpec.Type] - } else { + + default: if _, exists := upperBounds[infra.Spec.PlatformSpec.Type]; !exists { return []*junitapi.JUnitTestCase{{ Name: testName, @@ -413,19 +425,26 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) { watchRequestCounts := s.SummarizeWatchCountRequests() - if len(watchRequestCounts) > 0 { + if len(watchRequestCounts) == 0 { ret = append(ret, &junitapi.JUnitTestCase{ Name: testMinRequestsName, + FailureOutput: &junitapi.FailureOutput{ + Message: "Expected at least one watch request count to be present", + }, }, ) + // flake for now + ret = append(ret, + &junitapi.JUnitTestCase{ + Name: testMinRequestsName, + }, + ) + } else { ret = append(ret, &junitapi.JUnitTestCase{ Name: testMinRequestsName, - FailureOutput: &junitapi.FailureOutput{ - Message: "Expected at least one watch request count to be present", - }, }, ) }