Skip to content

refactor verifiers to improve/simplify polling#5365

Open
mgahagan73 wants to merge 1 commit into
Azure:mainfrom
mgahagan73:verifyier-diag-fix
Open

refactor verifiers to improve/simplify polling#5365
mgahagan73 wants to merge 1 commit into
Azure:mainfrom
mgahagan73:verifyier-diag-fix

Conversation

@mgahagan73
Copy link
Copy Markdown
Collaborator

What

followup/refactor of #5175

Why

Use of EventuallyVerify() in previous form broke parallel verifier workflow.

Copilot AI review requested due to automatic review settings May 21, 2026 21:06
@mgahagan73 mgahagan73 added do-not-merge/work-in-progress ai-assisted AI/LLM tool was used to help create this MR labels May 21, 2026
@openshift-ci openshift-ci Bot requested review from deads2k and patriksuba May 21, 2026 21:06
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mgahagan73

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

The pull request process is described 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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 refactors E2E verifier polling so polling/delta-logging/diagnostics live inside verifier constructors (via WithPolling(...)) rather than using a test-level EventuallyVerify(...) wrapper, which enables running verifiers in parallel without breaking workflow.

Changes:

  • Introduces a generic polling wrapper (WithPolling + maybePoll + pollVerifier) for HostedClusterVerifier constructors.
  • Updates several verifiers (pull secret merge, operator install, catalog source readiness, image pull, DaemonSet readiness) to accept polling options and use the shared polling wrapper.
  • Refactors cluster_pullsecret E2E to call verifiers directly with WithPolling(...) and adds/updates verifier guidance in test/AGENTS.md.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/util/verifiers/pullsecret.go Adds polling options to pull-secret verifier; replaces bespoke syncer check with a DaemonSet-ready verifier.
test/util/verifiers/poll.go Adds shared polling wrapper with delta-only logging, elapsed timing, and optional diagnostics.
test/util/verifiers/operator.go Wires operator install verifier into shared polling + diagnostics; adds polling opts to catalog source verifier.
test/util/verifiers/image_pull.go Refactors image-pull verifier for stable/sorted error output and polling integration.
test/util/verifiers/eventually.go Removes the old EventuallyVerify helper.
test/util/verifiers/daemonset.go Adds reusable VerifyDaemonSetReady(...) verifier with optional polling.
test/util/verifiers/basic.go Removes DiagnosticVerifier interface (diagnostics now provided via polling wrapper).
test/e2e/cluster_pullsecret.go Switches from EventuallyVerify/inline Eventually loops to verifier constructors with WithPolling(...).
test/AGENTS.md Updates test authoring guidance to prefer polling inside verifiers to preserve parallelism.

Comment on lines +140 to +156
elapsed := time.Since(startTime)
if err == nil {
logVerifierTiming(name, "succeeded", elapsed)
return nil
}

logVerifierTiming(name, "timed out", elapsed)
if p.diagnose != nil {
diagCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
if details := p.diagnose(diagCtx, restConfig); details != "" {
logger.Info("Failure diagnostics", "name", name, "details", details)
if lastErr != nil {
return fmt.Errorf("%s timed out after %s: %w\n%s", name, elapsed.Round(time.Millisecond), lastErr, details)
}
return fmt.Errorf("%s timed out after %s\n%s", name, elapsed.Round(time.Millisecond), details)
}
if imagePullErrorReasons.Has(reason) {
imagePullErrors = append(imagePullErrors, fmt.Sprintf("pod %s container %s: %s - %s",
pod.Name, containerStatus.Name, reason, message))
} else if imageMatches || v.imageName == "" {
@mbukatov mbukatov self-requested a review May 26, 2026 17:19
@mbukatov
Copy link
Copy Markdown
Collaborator

I don't know why I missed this, will review it tomorrow.

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

Labels

ai-assisted AI/LLM tool was used to help create this MR approved do-not-merge/work-in-progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants