Skip to content

Conversation

@gangwgr
Copy link
Contributor

@gangwgr gangwgr commented Nov 19, 2025

Adding test cases for "Add support for event-ttl in Kube API Server Operator"

@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 19, 2025

@gangwgr: This pull request references CNTRLPLANE-1579 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.21.0" version, but no target version was set.

In response to this:

Adding test cases for "Add support for event-ttl in Kube API Server Operator"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Warning

Rate limit exceeded

@gangwgr has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between deeaede and ec9b1bc.

📒 Files selected for processing (4)
  • README.md (2 hunks)
  • cmd/cluster-kube-apiserver-operator-tests-ext/adapter/gotest_wrapper.go (1 hunks)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go (2 hunks)
  • test/e2e/event-ttl.go (1 hunks)

Walkthrough

Made test command and registry construction error-aware; replaced static test registration with auto-discovery and dynamic Go-test adapter; added an EventTTL e2e test; updated go.mod with ginkgo/gomega and related dependency changes.

Changes

Cohort / File(s) Summary
Test command & registry
cmd/cluster-kube-apiserver-operator-tests-ext/main.go
Constructors now return errors (newOperatorTestCommand() (*cobra.Command, error), prepareOperatorTestsRegistry() (*oteextension.Registry, error)); replaced static test registration with auto-discovery, added registry wiring for multiple suites/qualifiers/parents, per-spec timeout extraction, obsolete-test filtering, and error propagation into main.
Go test adapter (new)
cmd/cluster-kube-apiserver-operator-tests-ext/adapter/gotest_wrapper.go
New adapter exposing GoTestConfig/GoTestSuite types and functions: discovery of *_test.go files and TestXxx functions, AutoDiscoverAllGoTests, RunGoTestFile/RunGoTestSuite, JSON parsing of go test -json events, dynamic Ginkgo It generation, logging, environment/path handling.
E2E test added
test/e2e/event-ttl.go
New e2e test toggling/verifying EventTTL feature-gate, patching KubeAPIServer.eventTTLMinutes, waiting for apiserver rollout and config propagation, creating events and asserting expiration across TTLs (5,10,15 min); includes helper wait/verify functions and ginkgoLogger adapter.
Module dependencies
go.mod
Added/updated test and indirect dependencies: added github.com/onsi/gomega v1.38.2, github.com/go-task/slim-sprig/v3 v3.0.0; added github.com/onsi/ginkgo/v2 v2.25.1 with a replace to github.com/openshift/onsi-ginkgo/v2 ...; bumped several indirect versions (logr, pprof, protobuf).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Focus review on cmd/.../main.go for error paths, suite wiring, spec registration, and timeout/obsolete handling.
  • Inspect cmd/.../adapter/gotest_wrapper.go thoroughly for subprocess handling, JSON event parsing, concurrency, environment/path resolution, and Ginkgo integration.
  • Validate test/e2e/event-ttl.go for polling/backoff, rollout detection, wait-time correctness, cleanup and flakiness mitigation.
  • Check go.mod replace directives and new deps align with imports and CI.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 19, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: gangwgr
Once this PR has been reviewed and has the lgtm label, please assign benluddy for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
test/e2e/event-ttl.go (1)

209-422: Consider polling for event deletion instead of fixed Sleep to reduce test duration and flakiness

The per‑TTL test flow is clear and well‑structured, but the TTL validation currently:

  • Sleeps for the full waitDuration := (ttl + bufferMinutes) * time.Minute (Line 407).
  • Then checks once that the event is gone and errors contain "not found".

This has a few effects:

  • Tests always run for the full TTL+buffer even if the event expires much earlier.
  • If the event is briefly missing/available due to eventual consistency, a single Get right after the sleep can be a bit brittle.
  • For the 15‑minute case, this guarantees at least an 18‑minute wait just for the TTL portion.

You could instead poll for deletion with a reasonable interval and a hard timeout, which both shortens successful runs and gives you more observability when the TTL isn’t honored. For example:

- time.Sleep(waitDuration)
-
- // Verify event is deleted
- actualExpirationTime := time.Now()
- _, err = kubeClient.CoreV1().Events(testNamespace).Get(ctx, eventName, metav1.GetOptions{})
- o.Expect(err).To(o.HaveOccurred(), "event should be deleted after TTL")
- o.Expect(err.Error()).To(o.ContainSubstring("not found"), "event should return 'not found' error")
+ pollInterval := 30 * time.Second
+ var actualExpirationTime time.Time
+ err = wait.PollUntilContextTimeout(ctx, pollInterval, waitDuration, false, func(cxt context.Context) (bool, error) {
+ 	_, getErr := kubeClient.CoreV1().Events(testNamespace).Get(cxt, eventName, metav1.GetOptions{})
+ 	if getErr != nil && strings.Contains(getErr.Error(), "not found") {
+ 		actualExpirationTime = time.Now()
+ 		return true, nil
+ 	}
+ 	return false, nil
+ })
+ o.Expect(err).NotTo(o.HaveOccurred(), "event should be deleted within TTL+buffer")

This keeps the upper bound the same but allows the test to finish earlier on success and provides more structured handling if deletion is delayed.

cmd/cluster-kube-apiserver-operator-tests-ext/main.go (1)

63-165: Suite partitioning and spec post‑processing look consistent; double‑check Serial+Slow routing

The new OTE wiring looks thoughtfully structured:

  • conformance/parallel: anything without [Serial], [Slow], or [Timeout:].
  • conformance/serial: [Serial] tests that are not [Slow], with Parallelism: 1.
  • optional/slow: all [Slow] tests, plus [Timeout:] tests that are not [Serial], also with Parallelism: 1.
  • all: catch‑all suite.

Combined with the [Disruptive][Serial][Disruptive] normalization, this ensures disruptive tests can’t accidentally land in the parallel suite, and long‑running/timeout‑heavy tests are isolated in the slow suite.

One behavioral detail to be intentional about: tests tagged with both [Serial] and [Slow] (like the new EventTTL test) are excluded from conformance/serial and run only in the optional/slow suite (still serial due to Parallelism: 1). If that’s the desired classification, this setup looks good; if you want Serial+Slow tests to appear in both serial and slow suites, the serial suite qualifier would need to drop the !name.contains("[Slow]") condition.

The timeout extraction from [Timeout:...] into spec.Tags["timeout"] is straightforward and should work fine for the usual [Timeout:Xm] style tags used in these suites.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between d3e707d and 7692fe6.

⛔ Files ignored due to path filters (283)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/go-logr/logr/.golangci.yaml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-logr/logr/funcr/funcr.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/.editorconfig is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/.gitattributes is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/.gitignore is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/CHANGELOG.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/LICENSE.txt is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/README.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/Taskfile.yml is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/crypto.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/date.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/defaults.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/dict.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/doc.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/functions.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/list.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/network.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/numeric.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/reflect.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/regex.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/strings.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/go-task/slim-sprig/v3/url.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/.gitignore is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/CONTRIBUTING.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/LICENSE is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/Makefile is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/OWNERS is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/README.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/RELEASING.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/config/deprecated.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/core_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/core_dsl_patch.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/decorator_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/deprecated_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/formatter/colorable_others.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/formatter/colorable_windows.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/formatter/formatter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/build/build_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/command/abort.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/command/command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/boostrap_templates.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/bootstrap_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_templates.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generators_common.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/compile.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/gocovmerge.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/profiles_and_reports.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/test_suite.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/utils.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/verify_version.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/labels/labels_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/ginkgo.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/import.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/outline.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/outline_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/unfocus/unfocus_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/delta.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/delta_tracker.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/dependencies.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/package_hash.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/package_hashes.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/suite.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo_cli_dependencies.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/counter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/failer.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/focus.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/global/init.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/group.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/interrupt_handler/interrupt_handler.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/interrupt_handler/sigquit_swallower_unix.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/interrupt_handler/sigquit_swallower_windows.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/node.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/ordering.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_unix.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_wasm.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_win.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/client_server.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/http_client.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/http_server.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/rpc_client.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/rpc_server.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/parallel_support/server_handler.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report_bsd.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report_unix.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report_wasm.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_report_win.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/progress_reporter_manager.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/report_entry.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/spec.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/spec_context.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/spec_patch.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/suite.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/suite_patch.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/tree.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/internal/writer.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/deprecated_reporter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/json_report.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/reporter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/table_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/code_location.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/config.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/deprecated_types.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/deprecation_support.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/enum_support.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/errors.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/file_filter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/flags.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/label_filter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/report_entry.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/types.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/types_patch.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/ginkgo/v2/types/version.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/.gitignore is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/CHANGELOG.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/CONTRIBUTING.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/LICENSE is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/README.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/RELEASING.md is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/format/format.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/gomega_dsl.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/assertion.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/async_assertion.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/duration_bundle.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/gomega.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/gutil/post_ioutil.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/gutil/using_ioutil.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/polling_signal_error.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/internal/vetoptdesc.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/and.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/attributes_slice.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_a_directory.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_a_regular_file.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_closed_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_comparable_to_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_element_of_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_empty_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_false_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_identical_to.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_key_of_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_numerically_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_sent_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_temporally_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_true_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/be_zero_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/consist_of.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/contain_element_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/contain_elements_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/contain_substring_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/equal_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_each_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_exact_elements.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_existing_field_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_field.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_http_body_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_http_header_with_value_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_http_status_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_key_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_len_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_prefix_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_suffix_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/have_value.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/internal/miter/type_support_iter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/internal/miter/type_support_noiter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_error_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_json_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_regexp_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_xml_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/not.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/or.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/panic_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/receive_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/satisfy_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/semi_structured_data_support.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/succeed_matcher.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraph.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraphmatching.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/edge/edge.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/node/node.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/support/goraph/util/util.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/type_support.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/matchers/with_transform.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/onsi/gomega/types/types.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/logging.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/parallel.go is excluded by !vendor/**, !**/vendor/**
  • vendor/github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo/util.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/atom/atom.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/atom/table.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/charset/charset.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/const.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/doc.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/doctype.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/entity.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/escape.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/foreign.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/iter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/node.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/parse.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/render.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/net/html/token.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/charmap/charmap.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/charmap/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/encoding.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/htmlindex/map.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/htmlindex/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/internal/identifier/identifier.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/internal/identifier/mib.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/internal/internal.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/all.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/eucjp.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/iso2022jp.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/shiftjis.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/japanese/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/korean/euckr.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/korean/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/simplifiedchinese/all.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/simplifiedchinese/gbk.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/simplifiedchinese/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/traditionalchinese/big5.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/traditionalchinese/tables.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/unicode/override.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/encoding/unicode/unicode.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/internal/utf8internal/utf8internal.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/runes/cond.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/text/runes/runes.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/cover/profile.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/edge/edge.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/cursor.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/inspector.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/iter.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/typeof.go is excluded by !vendor/**, !**/vendor/**
  • vendor/golang.org/x/tools/go/ast/inspector/walk.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/encoding/protowire/wire.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/filedesc/editions.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/filedesc/presence.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/impl/message_opaque.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/impl/presence.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/internal/version/version.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/proto/merge.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go is excluded by !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go is excluded by !**/*.pb.go, !vendor/**, !**/vendor/**
  • vendor/modules.txt is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (3)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go (3 hunks)
  • go.mod (5 hunks)
  • test/e2e/event-ttl.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • test/e2e/event-ttl.go
  • go.mod
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
🔇 Additional comments (3)
go.mod (1)

53-80: Confirm ginkgo fork compatibility and keep module metadata in sync

The additional testing deps and the github.com/onsi/ginkgo/v2 replace to the OpenShift fork look consistent with the new E2E suite, but the required version (v2.25.1) differs from the fork tag (v2.6.1-…). It’s fine as long as the fork is API‑compatible with what this code uses, but that mismatch can make future upgrades confusing.

Please verify that:

  • go test ./... passes using this replace.
  • go mod tidy has been run so go.sum stays consistent with these changes.

Also applies to: 119-139

test/e2e/event-ttl.go (2)

428-557: Helpers for feature gate / rollout waiting look robust and debuggable

waitForFeatureGateEnabled and waitForAPIServerRollout use wait.PollUntilContextTimeout with clear logging, track attempts, and avoid treating transient API errors as hard failures. The rollout helper’s requirement that all kube‑apiserver pods be new (created after rolloutStartTime) and running is a good safety check to ensure a full rollout, and the logging of non‑running pods and revisions should make diagnosing flakes much easier.

No changes needed here from a correctness or maintainability standpoint.


559-644: ConfigMap‑based verification of event-ttl is pragmatic and defensive

The verifyEventTTLInConfigFile helper does a good job of:

  • Polling the config ConfigMap to handle races between pod readiness and config updates.
  • Requiring at least one running kube‑apiserver pod before checking config, which guards against checking during outages.
  • Matching event-ttl in several possible serialized forms and logging nearby context when the value doesn’t match.

This should make config drift around event-ttl relatively easy to debug. Looks good as‑is.

"k8s.io/client-go/kubernetes"
)

var _ = g.Describe("[Jira:kube-apiserver][sig-api-machinery][FeatureGate:EventTTL] Event TTL Configuration", g.Ordered, func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a requirement to use the ginkgo framework to write the test cases ?
could we use standard golang framework ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is requirement to use like this by ote team

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, from what I’ve been able to gather, it looks like there might be a way to run standard go tests with OTE. (xref: https://redhat-internal.slack.com/archives/C07RDCVEYJG/p1763540247211469)

The issue is that no one has actually tried it, since everyone seems to be using ginkgo. If we want to continue writing tests using the standard go testing framework, or avoid rewriting the existing tests, then we need to build an adapter (if that’s even possible).

I’d like to hear from @benluddy, @bertinatto, @sanchezl and @dinhxuanvu to get consensus on which framework we would like to use.

Copy link
Member

@dinhxuanvu dinhxuanvu Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a problem with continue to use gingko to write test cases? If all of current test cases use gingko then I don't see why we need to switch to standard go testing framework unless there are some limitations that I don't know about?

I'm not sure how many tests we have in this repo but if there ain't too many, it may be faster jus to convert them all to not use gingko if we intend to use standard go testing moving forward. Having two different testing libraries and using an adapter seem to be a maintainance nightmare in the long run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is the other way around. the existing tests use the standard go testing framework and this PR proposes to use ginkgo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@p0lyn0mial By creating new adapter able to identify new non ginkgo cases with ote. But facing 2 problems
Go does not include _test.go files in go build, so OTE cannot see or run them. Only regular .go files are included in the OTE binary.
We have two options:

  1. Keep tests separate:
    Existing _test.go tests run with go test.
    New OTE tests use .go files and run through OTE.
  2. Migrate all tests to OTE:
    Rename _test.go → .go
    Change TestX(t *testing.T) → testX(t adapter.T)
    Register tests using adapter.RunTests().
    And _test.go files cannot be used with OTE because Go excludes them during go build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@p0lyn0mial able to run old go cases with ote

 make build
go build -mod=vendor -trimpath -ldflags "-X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.versionFromGit="v4.0.0-alpha.0-2271-gd5d7299" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.commitFromGit="d5d729906" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.gitTreeState="clean" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.buildDate="2025-11-20T11:00:45Z" " github.com/openshift/cluster-kube-apiserver-operator/cmd/cluster-kube-apiserver-operator
go build -mod=vendor -trimpath -ldflags "-X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.versionFromGit="v4.0.0-alpha.0-2271-gd5d7299" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.commitFromGit="d5d729906" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.gitTreeState="clean" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.buildDate="2025-11-20T11:00:46Z" " github.com/openshift/cluster-kube-apiserver-operator/cmd/cluster-kube-apiserver-operator-tests-ext
go build -mod=vendor -trimpath -ldflags "-X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.versionFromGit="v4.0.0-alpha.0-2271-gd5d7299" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.commitFromGit="d5d729906" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.gitTreeState="clean" -X github.com/openshift/cluster-kube-apiserver-operator/pkg/version.buildDate="2025-11-20T11:00:46Z" " github.com/openshift/cluster-kube-apiserver-operator/cmd/cluster-kube-apiserver-operator-tests-ext/adapter
rgangwar@rgangwar-mac cluster-kube-apiserver-operator % ./cluster-kube-apiserver-operator-tests-ext run-test "[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/bound_sa_token_test.go:TestTokenRequestAndReview [Serial]"
  Running Suite:  - /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator
  ========================================================================================
  Random Seed: 1763636546 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/bound_sa_token_test.go:TestTokenRequestAndReview [Serial]
  github.com/openshift/cluster-kube-apiserver-operator/cmd/cluster-kube-apiserver-operator-tests-ext/adapter/gotest_wrapper.go:141
    STEP: Running go test on test/e2e/bound_sa_token_test.go:TestTokenRequestAndReview @ 11/20/25 16:32:26.19
    STEP: Executing: go test -v -json -run TestTokenRequestAndReview bound_sa_token_test.go (in /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator/test/e2e) @ 11/20/25 16:32:26.191
  === RUN   TestTokenRequestAndReview
  Found configuration for host https://api.rg-a9.qe.devcluster.openshift.com:6443.
  --- PASS: TestTokenRequestAndReview (1.96s)
  PASS: TestTokenRequestAndReview (1.96s)
    STEP: Results: 1 passed, 0 failed, 0 skipped @ 11/20/25 16:32:31.251
    STEP: All tests passed for test/e2e/bound_sa_token_test.go:TestTokenRequestAndReview @ 11/20/25 16:32:31.251
  • [5.060 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 5.060 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/bound_sa_token_test.go:TestTokenRequestAndReview [Serial]",
    "lifecycle": "blocking",
    "duration": 5060,
    "startTime": "2025-11-20 11:02:26.190664 UTC",
    "endTime": "2025-11-20 11:02:31.251100 UTC",
    "result": "passed",
    "output": "  STEP: Running go test on test/e2e/bound_sa_token_test.go:TestTokenRequestAndReview @ 11/20/25 16:32:26.19\n  STEP: Executing: go test -v -json -run TestTokenRequestAndReview bound_sa_token_test.go (in /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator/test/e2e) @ 11/20/25 16:32:26.191\n=== RUN   TestTokenRequestAndReview\nFound configuration for host https://api.rg-a9.qe.devcluster.openshift.com:6443.\n--- PASS: TestTokenRequestAndReview (1.96s)\nPASS: TestTokenRequestAndReview (1.96s)\n  STEP: Results: 1 passed, 0 failed, 0 skipped @ 11/20/25 16:32:31.251\n  STEP: All tests passed for test/e2e/bound_sa_token_test.go:TestTokenRequestAndReview @ 11/20/25 16:32:31.251\n"
  }
]%                                                                                                                                                                                                                               rgangwar@rgangwar-mac cluster-kube-apiserver-operator % ./cluster-kube-apiserver-operator-tests-ext run-test "[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/bound_sa_token_test.go:TestBoundTokenSignerController [Serial]"
  Running Suite:  - /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator
  ========================================================================================
  Random Seed: 1763636567 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/bound_sa_token_test.go:TestBoundTokenSignerController [Serial]
  github.com/openshift/cluster-kube-apiserver-operator/cmd/cluster-kube-apiserver-operator-tests-ext/adapter/gotest_wrapper.go:141
    STEP: Running go test on test/e2e/bound_sa_token_test.go:TestBoundTokenSignerController @ 11/20/25 16:32:47.091
    STEP: Executing: go test -v -json -run TestBoundTokenSignerController bound_sa_token_test.go (in /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator/test/e2e) @ 11/20/25 16:32:47.091
  === RUN   TestBoundTokenSignerController
  Found configuration for host https://api.rg-a9.qe.devcluster.openshift.com:6443.
  === RUN   TestBoundTokenSignerController/operand-secret-deletion
      bound_sa_token_test.go:54: 
  === RUN   TestBoundTokenSignerController/configmap-deletion
      bound_sa_token_test.go:63: 
  === RUN   TestBoundTokenSignerController/operator-secret-deletion
      bound_sa_token_test.go:80: 
  --- PASS: TestBoundTokenSignerController (0.74s)
      --- SKIP: TestBoundTokenSignerController/operand-secret-deletion (0.00s)
  SKIP: TestBoundTokenSignerController/operand-secret-deletion
      --- SKIP: TestBoundTokenSignerController/configmap-deletion (0.00s)
  SKIP: TestBoundTokenSignerController/configmap-deletion
      --- SKIP: TestBoundTokenSignerController/operator-secret-deletion (0.00s)
  SKIP: TestBoundTokenSignerController/operator-secret-deletion
  PASS: TestBoundTokenSignerController (0.74s)
    STEP: Results: 1 passed, 0 failed, 3 skipped @ 11/20/25 16:32:49.759
    STEP: All tests passed for test/e2e/bound_sa_token_test.go:TestBoundTokenSignerController @ 11/20/25 16:32:49.759
  • [2.668 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 2.668 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/bound_sa_token_test.go:TestBoundTokenSignerController [Serial]",
    "lifecycle": "blocking",
    "duration": 2667,
    "startTime": "2025-11-20 11:02:47.091506 UTC",
    "endTime": "2025-11-20 11:02:49.759277 UTC",
    "result": "passed",
    "output": "  STEP: Running go test on test/e2e/bound_sa_token_test.go:TestBoundTokenSignerController @ 11/20/25 16:32:47.091\n  STEP: Executing: go test -v -json -run TestBoundTokenSignerController bound_sa_token_test.go (in /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator/test/e2e) @ 11/20/25 16:32:47.091\n=== RUN   TestBoundTokenSignerController\nFound configuration for host https://api.rg-a9.qe.devcluster.openshift.com:6443.\n=== RUN   TestBoundTokenSignerController/operand-secret-deletion\n    bound_sa_token_test.go:54: \n=== RUN   TestBoundTokenSignerController/configmap-deletion\n    bound_sa_token_test.go:63: \n=== RUN   TestBoundTokenSignerController/operator-secret-deletion\n    bound_sa_token_test.go:80: \n--- PASS: TestBoundTokenSignerController (0.74s)\n    --- SKIP: TestBoundTokenSignerController/operand-secret-deletion (0.00s)\nSKIP: TestBoundTokenSignerController/operand-secret-deletion\n    --- SKIP: TestBoundTokenSignerController/configmap-deletion (0.00s)\nSKIP: TestBoundTokenSignerController/configmap-deletion\n    --- SKIP: TestBoundTokenSignerController/operator-secret-deletion (0.00s)\nSKIP: TestBoundTokenSignerController/operator-secret-deletion\nPASS: TestBoundTokenSignerController (0.74s)\n  STEP: Results: 1 passed, 0 failed, 3 skipped @ 11/20/25 16:32:49.759\n  STEP: All tests passed for test/e2e/bound_sa_token_test.go:TestBoundTokenSignerController @ 11/20/25 16:32:49.759\n"
  }
]%                                     

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./cluster-kube-apiserver-operator-tests-ext list tests 2>/dev/null | jq -r '.[].name'                                                                               
[Jira:kube-apiserver][sig-api-machinery][FeatureGate:EventTTL] Event TTL Configuration should configure and validate eventTTLMinutes=5m [Timeout:60m][Slow][Serial][OTP]
[Jira:kube-apiserver][sig-api-machinery][FeatureGate:EventTTL] Event TTL Configuration should configure and validate eventTTLMinutes=10m [Timeout:60m][Slow][Serial][OTP]
[Jira:kube-apiserver][sig-api-machinery][FeatureGate:EventTTL] Event TTL Configuration should configure and validate eventTTLMinutes=15m [Timeout:60m][Slow][Serial][OTP]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/bound_sa_token_test.go:TestBoundTokenSignerController [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/bound_sa_token_test.go:TestTokenRequestAndReview [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/certrotation_test.go:TestCertRotationTimeUpgradeable [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/certrotation_test.go:TestCertRotationStompOnBadType [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/deprecated_api_test.go:TestAPIRemovedInNextReleaseInUse [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/deprecated_api_test.go:TestAPIRemovedInNextEUSReleaseInUse [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/encryption_test.go:TestEncryptionTypeAESCBC [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/operator_test.go:TestOperatorNamespace [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/operator_test.go:TestOperandImageVersion [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/operator_test.go:TestRevisionLimits [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/serviceaccountissuer_test.go:TestServiceAccountIssuer [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/user_certs_test.go:TestNamedCertificates [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/user_client_ca_test.go:TestUserClientCABundle [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e/user_cors_test.go:TestAdditionalCORSAllowedOrigins [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e-encryption/encryption_test.go:TestEncryptionTypeIdentity [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e-encryption/encryption_test.go:TestEncryptionTypeUnset [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e-encryption/encryption_test.go:TestEncryptionTurnOnAndOff [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e-encryption-perf/encryption_perf_test.go:TestPerfEncryption [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e-encryption-rotation/encryption_rotation_test.go:TestEncryptionRotation [Serial]
[sig-api-machinery] kube-apiserver operator Standard Go Tests test/e2e-sno-disruptive/sno_disruptive_test.go:TestFallback [Serial]
rgangwar@rgangwar-mac cluster-kube-apiserver-operator % ./cluster-kube-apiserver-operator-tests-ext list tests 2>/dev/null | jq -r '.[].name' | wc -l                                                                       
      23

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use both ginkgo and standard go test cases.
I prefer future cases to use ginkgo.

Copy link
Contributor Author

@gangwgr gangwgr Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with normal go

 cd test/e2e && go test -v -run TestOperatorNamespace
=== RUN   TestOperatorNamespace
Found configuration for host https://xxxxx.
--- PASS: TestOperatorNamespace (0.70s)
PASS
ok  	github.com/openshift/cluster-kube-apiserver-operator/test/e2e	1.435s

// no-op, logic is provided by the OTE framework
if err := cmd.Help(); err != nil {
klog.Fatal(err)
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the change ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I refactored the error handling earlier, I changed it to be consistent with the new registry error handling pattern, I think that time I got some compiling issue let me try again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated old one

cmd.AddCommand(otecmd.DefaultExtensionCommands(registry)...)

return cmd
code := cli.Run(cmd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the change ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

during refactoring I have changed for consistency with standard ote main.go not any specific reason

registry := oteextension.NewRegistry()
extension := oteextension.NewExtension("openshift", "payload", "cluster-kube-apiserver-operator")

// Suite: conformance/parallel (fast, parallel-safe)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which suites are required to run the EventTTL test ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It runs with suite openshift/cluster-kube-apiserver-operator/optional/slow

"k8s.io/client-go/kubernetes"
)

var _ = g.Describe("[Jira:kube-apiserver][sig-api-machinery][FeatureGate:EventTTL] Event TTL Configuration", g.Ordered, func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which CI job will run this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is long duration cases I will create new ci job for that.

}
})

// Ignore obsolete tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@p0lyn0mial this is for if we want to stop cases for sometime from running cases in ci.

})

// Ignore obsolete tests
extension.IgnoreObsoleteTests(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as this #1967 (comment)

})

// Extract timeout from test name if present (e.g., [Timeout:50m])
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is needed because some cases we have longduration cases like we have cases which have duration 30-40mins
but job has default has case timeout only 15mins to extended that we need Timeout tag, same we do in origin cases

})

// Preserve original-name labels for renamed tests
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It extracts the original name from a label like original-name:SomeOldTestName and populates the OriginalName field of the test spec. You rename tests but want to preserve historical test results that's why we are using. We can remove that but it is standard main.go shared by ote team

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

// Build ginkgo test specs from the test/e2e package
specs, err := g.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
if err != nil {
panic(fmt.Sprintf("couldn't build extension test specs from ginkgo: %+v", err.Error()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not to return the error ? why do we have to panic ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


// Initialize environment before running any tests
specs.AddBeforeAll(func() {
// do stuff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

}

// Ensure [Disruptive] tests are also [Serial]
specs = specs.Walk(func(spec *et.ExtensionTestSpec) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@p0lyn0mial some qe cases we have tag disruptive to considered those are serial. that's why I will remove that it is waste, we have serial tag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/e2e/event-ttl.go (2)

378-422: Consider polling for event deletion instead of a single long Sleep to reduce runtime and flakiness

The current TTL check waits for ttl + bufferMinutes using a single time.Sleep(waitDuration) and then performs one Get to assert the event is gone. This is functionally correct for detecting “TTL not applied” (the event will still exist if it’s stuck at the default 3h), but it forces each test case to wait the full TTL+buffer (up to ~18 minutes here) even if the event expired much earlier and gives no signal if it expired significantly before the configured TTL.

You could make this more efficient and slightly more robust by polling for deletion with a shorter interval, exiting as soon as you observe NotFound, and optionally asserting that deletion didn’t occur too early (e.g. before ttl minutes have elapsed). That would shorten successful runs and provide tighter bounds on TTL behavior while preserving the overall semantics.


463-560: Rollout detection could be made more resilient by leveraging revision labels instead of creation time

waitForAPIServerRollout currently treats “new” pods as those with CreationTimestamp after rolloutStartTime and requires that all listed pods meet that condition and are Running. This generally works when you call it immediately after applying a config change, but it does rely on call timing: if a rollout starts and completes very quickly before this helper is invoked, those already‑rolled‑out pods will be treated as “old”, and the condition may never become true, leading to timeouts despite a healthy cluster.

Since you already collect initialRevision and log the current revision from pod labels, you could make this more robust by driving success off revision changes (e.g., all pods Running and their revision label different from initialRevision) instead of or in addition to creation time. That would decouple the check from when the helper is called and reduce the chance of false negatives in fast or out‑of‑band rollouts.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 974d5a2 and 69553a4.

📒 Files selected for processing (2)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go (2 hunks)
  • test/e2e/event-ttl.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
  • test/e2e/event-ttl.go
🔇 Additional comments (2)
cmd/cluster-kube-apiserver-operator-tests-ext/main.go (1)

10-26: Registry wiring, suite qualifiers, and timeout tagging look consistent and robust

The move to prepareOperatorTestsRegistry() with error returns, the Cobra/cli.Run integration, and the OTE registry/suite setup all look correct. The suite qualifiers and [Timeout:...] tag extraction are consistent with the described behavior and should correctly route long‑running [Slow][Serial][Timeout:...] tests like EventTTL into the optional/slow (and all) suites without overlaps. I don’t see any functional or maintainability blockers here.

Also applies to: 28-56, 63-144

test/e2e/event-ttl.go (1)

25-211: Overall EventTTL suite, feature gate lifecycle, and helpers look solid

The Ordered Ginkgo suite, feature‑gate enable/restore logic, rollout waits, and verification helpers are all structured carefully and defensively (good use of read‑modify‑write, explicit restore path, cluster stabilization waits, and guarded logging). The per‑TTL tests correctly snapshot and restore spec.EventTTLMinutes, isolate work in a dedicated namespace, and validate both config propagation and eventual event deletion. I don’t see correctness or safety issues that would block merging from this file.

Also applies to: 432-648

@gangwgr gangwgr force-pushed the test-infrastructure-setup-v2 branch 2 times, most recently from a636219 to 1ff12c1 Compare November 19, 2025 16:39
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/e2e/event-ttl.go (2)

463-561: Rollout detector may hang when rollout is already complete or is a no‑op

waitForAPIServerRollout only reports success when all current pods were created after rolloutStartTime (Line 492). If:

  • kube‑apiserver has already fully rolled out before this helper is called (e.g., after the feature gate change while waitForFeatureGateEnabled is still polling), or
  • a given spec change doesn’t actually trigger a new revision (no new pods are created),

then no pods will ever satisfy pod.CreationTimestamp.After(rolloutStartTime), and the function will poll until the timeout expires even though the cluster is already stable.

Because this helper is used after feature gate changes and in cleanup paths, that can turn harmless no‑op transitions into 20–25 minute false failures.

Consider making success detection revision‑based instead of wall‑clock‑based, e.g.:

  • Capture initialRevision from the revision label in the initial pod list.
  • In the poll loop, consider rollout complete when:
    • all kube‑apiserver pods are Running, and
    • they all share a single non‑empty revision label, and
    • that revision differs from initialRevision (or initialRevision was empty), or some explicit “no‑rollout needed” condition is met.

This avoids depending on “new pods must be younger than when we started waiting” and should make the helper robust both when rollout is fast and when a change is a no‑op.


213-427: Re‑evaluate number of TTL variants and strict time.Sleep to keep CI runtime under control

The test loops over []int32{5, 10, 15} and, for each value, performs:

  • a full kube‑apiserver rollout wait (up to 20 minutes), plus
  • a hard time.Sleep(waitDuration) where waitDuration = (ttl + 3) * time.Minute (Lines 379–381, 411).

Run sequentially, the worst‑case wall‑clock time for this single describe block can easily exceed what most jobs tolerate, especially if rollout is slow.

To keep the optional/slow job healthy while still validating the feature, consider:

  • Reducing the number of tested TTL values (e.g., a single representative value such as 5 or 10 minutes), or
  • Keeping multiple TTLs but replacing the single long time.Sleep with a poll (e.g., wait.PollUntilContextTimeout) that checks for deletion and bails out as soon as the event disappears, within a capped maximum of ttl+buffer.

This keeps coverage but avoids “always wait full ttl+buffer for each variant” and reduces the impact of occasional slow rollouts.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between a636219 and 1ff12c1.

📒 Files selected for processing (2)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go (2 hunks)
  • test/e2e/event-ttl.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • test/e2e/event-ttl.go
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
🔇 Additional comments (1)
cmd/cluster-kube-apiserver-operator-tests-ext/main.go (1)

39-151: Registry wiring and error propagation look solid

The refactor to have newOperatorTestCommand / prepareOperatorTestsRegistry return errors, plus the suite definitions and [Timeout:…] tag extraction, all look consistent with OTE patterns and give you clearer failure surfaces. The qualifiers also correctly route [Slow][Serial][Timeout:…] tests like the EventTTL one into the optional/slow suite only.

No changes requested here.

@gangwgr gangwgr force-pushed the test-infrastructure-setup-v2 branch from 1ff12c1 to d5d7299 Compare November 20, 2025 04:41
@gangwgr
Copy link
Contributor Author

gangwgr commented Nov 20, 2025

/test e2e-aws-ovn-upgrade

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
test/e2e/event-ttl.go (2)

42-52: Make stdout redirection safer and less brittle

Rebinding os.Stdout at process scope is fragile, and os.Open(os.DevNull) errors are ignored (could leave os.Stdout nil and cause panics). Consider:

  • Checking the os.Open error and failing early if it cannot be opened.
  • Using a defer to restore os.Stdout and close devNull, so future edits don’t accidentally miss the restore path.

For example:

oldStdout := os.Stdout
devNull, err := os.Open(os.DevNull)
o.Expect(err).NotTo(o.HaveOccurred(), "failed to open os.DevNull")
defer func() {
	os.Stdout = oldStdout
	_ = devNull.Close()
}()

os.Stdout = devNull
kubeConfig, err := libgotest.NewClientConfigForTest()

This keeps the hack localized and safer while preserving the intent of suppressing noisy output.


414-453: Use poll + typed NotFound check instead of fixed sleep + string matching

Right now the test:

  • Always sleeps ttl+bufferMinutes even if the event is deleted early.
  • Asserts deletion by checking err.Error() contains "not found", which is brittle against error‑message changes.

It would be more robust (and often faster) to:

  • Use wait.PollUntilContextTimeout (or similar) to periodically Get the event until apierrors.IsNotFound(err) is true or a timeout is hit.
  • Fail on timeouts explicitly, and use errors.IsNotFound instead of string matching.

This reduces flakiness and better documents the intended contract with the API.

cmd/cluster-kube-apiserver-operator-tests-ext/adapter/gotest_wrapper.go (2)

192-238: Don’t silently drop non‑JSON go test -json output

In the JSON parsing loop, any line that fails json.Unmarshal is just continued, which means non‑JSON stdout from go test is discarded. While stderr is printed later, interesting diagnostics or panics sometimes appear on stdout, especially when tests or the go tool emit unexpected output.

Consider:

  • Logging lines that fail JSON parsing to GinkgoWriter (perhaps at a lower verbosity), or
  • Falling back to dumping the raw stdout buffer when runErr != nil.

This will make debugging failing/disrupted suites significantly easier.


41-45: Align default lifecycle handling between RunGoTestFile and RunGoTestSuite

RunGoTestFile treats a nil Lifecycle as ote.Informing(), whereas RunGoTestSuite passes a nil Lifecycle straight through to g.It. That difference is subtle and could surprise future callers who expect both helpers to behave the same when Lifecycle isn’t set.

Either:

  • Apply the same defaulting in RunGoTestSuite (e.g., default to ote.Informing() when Lifecycle is nil), or
  • Remove the defaulting from RunGoTestFile and require callers to always choose a lifecycle explicitly.

Picking one consistent convention will make the adapter easier to use correctly.

Also applies to: 138-141

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between d5d7299 and deeaede.

📒 Files selected for processing (3)
  • cmd/cluster-kube-apiserver-operator-tests-ext/adapter/gotest_wrapper.go (1 hunks)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go (2 hunks)
  • test/e2e/event-ttl.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • test/e2e/event-ttl.go
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
  • cmd/cluster-kube-apiserver-operator-tests-ext/adapter/gotest_wrapper.go
🔇 Additional comments (1)
cmd/cluster-kube-apiserver-operator-tests-ext/main.go (1)

96-139: Suite and registry wiring for OTE looks consistent

The registry construction and suite qualifiers (parallel/serial/optional‑slow/all) align with the documented rules and correctly route [Slow]/[Serial]/[Timeout:...] tests like the EventTTL cases into openshift/cluster-kube-apiserver-operator/optional/slow. Error‑aware construction via prepareOperatorTestsRegistry() and newOperatorTestCommand() also looks good.

@gangwgr
Copy link
Contributor Author

gangwgr commented Nov 20, 2025

/test e2e-aws-ovn-upgrade

@gangwgr gangwgr force-pushed the test-infrastructure-setup-v2 branch from deeaede to ec9b1bc Compare November 20, 2025 14:02
@gangwgr
Copy link
Contributor Author

gangwgr commented Nov 20, 2025

/test e2e-aws-ovn-upgrade

@gangwgr
Copy link
Contributor Author

gangwgr commented Nov 20, 2025

/test e2e-aws-ovn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants