Skip to content

test: improve Eventually() polling diagnostics in cluster TLS endpoint test#5999

Open
aklymenk wants to merge 1 commit into
Azure:mainfrom
aklymenk:test/tls-endpoint-eventually-logging
Open

test: improve Eventually() polling diagnostics in cluster TLS endpoint test#5999
aklymenk wants to merge 1 commit into
Azure:mainfrom
aklymenk:test/tls-endpoint-eventually-logging

Conversation

@aklymenk

@aklymenk aklymenk commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

What

Improves logging across all three Eventually() polling loops in cluster_tls_endpoints.go:

  • Ingress certificate check: tracks the last-seen issuer and error, logging only on first observation or when the value changes, plus a guaranteed final-state summary via defer (as suggested here).
  • API certificate check: adds the same delta-only logging (previously completely silent while polling, only logged once, on success) plus a final-state summary via defer — unlike the ingress one, this only fires when there's an actual error to report, since success is already marked by the existing interior log.
  • Console URL wait: converts the polled closure from bool-returning to error-returning so Gomega's own timeout message is descriptive (Expected success, but got an error: ...) instead of the generic Expected <bool>: false to be true; adds the same delta-only logging plus the same conditional final-state summary via defer; removes a dead Expect(...).NotTo(BeNil()) check that could never fail given the preceding guard clause.
  • All three loops now accept ctx context.Context and call .WithContext(ctx). This lets Gomega's own polling loop react to external context cancellation with a clean "Context was cancelled" failure instead of grinding through its full timeout budget regardless.

Why

Ingress-cert loop loggs the same issuer line on every poll regardless of whether anything changed (example of 'bad' output can be found here. Investigating further surfaced that the other two loops had the opposite problem: they were silent while polling, giving zero visibility into what was blocking them until either success or the final timeout. A second round of review also pointed out these loops weren't context-aware, meaning they couldn't respond to external cancellation cleanly. This PR addresses all three issues so the test's diagnostics accurately reflect what's happening during a 10-15 minute wait.

Testing

This PR modifies logging/diagnostics/cancellation behavior in an existing E2E test rather than adding new test coverage, so.

PR Checklist

  • PR is scoped to a single task (no mixed concerns)
  • Title follows Conventional Commits format
  • Summary explains the "Why" behind the change
  • Linked to relevant ticket/issue
  • Screenshots included (if graph/UI/metrics changes)
  • Self-reviewed the diff
  • CI/CD checks are passing (ignore Tide)
  • Draft PR used for WIP (if applicable)
  • Commit history is clean (rebased/squashed)
  • Tricky code blocks are commented
  • Specific reviewers tagged
  • All comment threads resolved before merge

Copilot AI review requested due to automatic review settings July 9, 2026 16:32
@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves diagnostics in the cluster_tls_endpoints E2E test by adding delta-only logging during Eventually() polling and by switching a console URL wait from a bool predicate to an error predicate so timeouts are more descriptive.

Changes:

  • Added delta-only logging for API certificate polling so stuck polling surfaces the current blocking error.
  • Converted the console URL wait to Eventually(func() error) with delta-only logging and a clearer Gomega timeout message.
  • Reduced ingress certificate polling log spam by logging issuer changes only, and added a deferred final-state summary log.

Comment thread test/e2e/cluster_tls_endpoints.go Outdated
Copilot AI review requested due to automatic review settings July 9, 2026 16:58
@aklymenk aklymenk force-pushed the test/tls-endpoint-eventually-logging branch from 3433754 to bd20d03 Compare July 9, 2026 16:58
@aklymenk aklymenk changed the title test: improve Eventually() polling diagnostics in cluster TLS endpoin… test: improve Eventually() polling diagnostics in cluster TLS endpoint test Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

Comment thread test/e2e/cluster_tls_endpoints.go Outdated
Comment thread test/e2e/cluster_tls_endpoints.go Outdated
Comment thread test/e2e/cluster_tls_endpoints.go Outdated
Comment thread test/e2e/cluster_tls_endpoints.go Outdated
Comment thread test/e2e/cluster_tls_endpoints.go
Copilot AI review requested due to automatic review settings July 9, 2026 17:19
@aklymenk aklymenk force-pushed the test/tls-endpoint-eventually-logging branch from bd20d03 to a4d8ef0 Compare July 9, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@aklymenk

aklymenk commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/test ?

@aklymenk

aklymenk commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/test integration-e2e-parallel

@aklymenk aklymenk marked this pull request as draft July 10, 2026 05:54
…t test

The ingress-cert Eventually() block logged the same issuer line on every poll regardless of whether anything changed. The API-cert and console-URL Eventually() blocks had the opposite problem: completely silent while polling, giving zero visibility if they got stuck.

- Ingress cert check: track last-seen issuer and error, log only on first observation or change, plus a guaranteed final-state summary via defer.
- API cert check: same delta-only logging, added for visibility that didn't exist before.
- Console URL wait: same delta-only logging, plus converted from a bool-returning closure to error-returning so Gomega's own timeout message is now descriptive instead of "Expected <bool>: false to be true".
@aklymenk aklymenk force-pushed the test/tls-endpoint-eventually-logging branch from a4d8ef0 to e81a8a9 Compare July 10, 2026 16:24
@aklymenk aklymenk marked this pull request as ready for review July 10, 2026 16:27
Copilot AI review requested due to automatic review settings July 10, 2026 16:27
@openshift-ci openshift-ci Bot requested review from bennerv and miquelsi July 10, 2026 16:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


By("examining the server certificate returned by the default ingress when routing the console URL")
// Wait for the certificate to be loaded after console starts
consoleUrlWithPort := fmt.Sprintf("%s:%d", consoleURL, 443)
@aklymenk

Copy link
Copy Markdown
Collaborator Author

/test integration-e2e-parallel

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

@aklymenk: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-e2e-parallel e81a8a9 link false /test integration-e2e-parallel

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Eventually(func() error {
var lastIngressIssuer, lastIngressErr string
defer func() {
GinkgoLogr.Info("Ingress certificate final state", "issuer", lastIngressIssuer, "error", lastIngressErr)

@mgahagan73 mgahagan73 Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add a check to see if lastIngressErr is not empty here, otherwise we would be logging an empty error message we don't need. See line 166. Maybe something like:
defer func() {
kv := []any{"issuer", lastIngressIssuer}
if lastIngressErr != "" {
kv = append(kv, "error", lastIngressErr)
}
GinkgoLogr.Info("Ingress certificate final state", kv...)
}()

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants