refactor verifiers to improve/simplify polling#5365
Conversation
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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) forHostedClusterVerifierconstructors. - 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_pullsecretE2E to call verifiers directly withWithPolling(...)and adds/updates verifier guidance intest/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. |
| 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 == "" { |
|
I don't know why I missed this, will review it tomorrow. |
What
followup/refactor of #5175
Why
Use of EventuallyVerify() in previous form broke parallel verifier workflow.