MCO-2205: Make ImageModeStatusReporting MCP count test more resilient on SNO#6303
MCO-2205: Make ImageModeStatusReporting MCP count test more resilient on SNO#6303isabella-janssen wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@isabella-janssen: This pull request references MCO-2205 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 spike to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
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. |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe image mode status reporting test simplifies CLI setup, removes an unnecessary return, uses deadline-based machine-count transition retries, and applies shared transient connection error handling to MCP and node retrieval. ChangesImage mode status reporting
Estimated code review effort: 3 (Moderate) | ~20 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: isabella-janssen 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 |
3cfb394 to
da53bae
Compare
|
/payload-job periodic-ci-openshift-machine-config-operator-release-5.0-periodics-e2e-aws-mco-single-node-disruptive-techpreview-1of3 periodic-ci-openshift-machine-config-operator-release-5.0-periodics-e2e-aws-mco-single-node-disruptive-techpreview-2of3 periodic-ci-openshift-machine-config-operator-release-5.0-periodics-e2e-aws-mco-single-node-disruptive-techpreview-3of3 |
|
@isabella-janssen: trigger 3 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/b06371a0-7fa3-11f1-8330-cd5287550209-0 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/extended/image_mode_status_reporting.go (1)
403-446: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winPrefer
StopTrying(...).Now()overg.Fail()inside theEventuallypoll closure.Calling
g.Fail(...)(ginkgo'sFail) from inside thefunc() boolpolled byo.Eventually(...)is non-idiomatic. Gomega shipsStopTrying(message).Now()specifically for abortingEventually/Consistentlyearly with a failure, and its failure message correctly surfaces at the top-level assertion rather than relying on a rawFailpanic unwinding through Gomega'sAsyncAssertioninternals. This also lets you drop the manual reset/format boilerplate. Additionally, the message grammar is slightly off ("do not matched expected values").♻️ Suggested refactor
if !countsMatch { if firstMismatchTime.IsZero() { firstMismatchTime = time.Now() } elapsed := time.Since(firstMismatchTime) if elapsed > mismatchDeadline { - g.Fail(fmt.Sprintf("MCP '%v' machine counts do not matched expected values.", - mcpName)) + o.StopTrying(fmt.Sprintf("MCP '%v' machine counts did not match expected values for over %v.", + mcpName, mismatchDeadline)).Now() } logger.Infof("Counts do not match yet. Will retry.") return false }Please double check with a quick local/CI run that
g.Fail()here reliably short-circuits before the full 15/45-minuteEventuallytimeout rather than being retried — the exact interaction depends on the Gomega/Ginkgo version pinned ingo.mod.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/extended/image_mode_status_reporting.go` around lines 403 - 446, Update validateMCPMachineCountTransitions to replace the g.Fail call inside the Eventually polling closure with Gomega’s StopTrying(...).Now() when elapsed exceeds mismatchDeadline. Preserve the existing MCP name and mismatch context in the failure message, correct the grammar to “do not match expected values,” and remove any now-unnecessary manual failure handling while keeping retry behavior unchanged before the deadline.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/extended/image_mode_status_reporting.go`:
- Around line 403-446: Update validateMCPMachineCountTransitions to replace the
g.Fail call inside the Eventually polling closure with Gomega’s
StopTrying(...).Now() when elapsed exceeds mismatchDeadline. Preserve the
existing MCP name and mismatch context in the failure message, correct the
grammar to “do not match expected values,” and remove any now-unnecessary manual
failure handling while keeping retry behavior unchanged before the deadline.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 41e75ca0-1e5e-4476-ae47-3de686557219
📒 Files selected for processing (1)
test/extended/image_mode_status_reporting.go
d5c0ce6 to
8f439d0
Compare
|
/test verify |
- What I did
This adds some resiliency to the ImageModeStatusReporting test to help prevent against flakes as seen in https://prow.ci.openshift.org/view/gs/test-platform-results/logs/periodic-ci-openshift-machine-config-operator-release-5.0-periodics-e2e-aws-mco-single-node-disruptive-techpreview-3of3/2075276858378686464.
- How to verify it
All ImageModeStatusReporting tests should continue passing in the non-SNO suite and start consistently passing in the SNO suite.
- Description for the changelog
MCO-2205: Make ImageModeStatusReporting MCP count test more resilient on SNO
Summary by CodeRabbit