Skip to content

MCO-2205: Make ImageModeStatusReporting MCP count test more resilient on SNO#6303

Draft
isabella-janssen wants to merge 1 commit into
openshift:mainfrom
isabella-janssen:disrutive-suite-stabilization
Draft

MCO-2205: Make ImageModeStatusReporting MCP count test more resilient on SNO#6303
isabella-janssen wants to merge 1 commit into
openshift:mainfrom
isabella-janssen:disrutive-suite-stabilization

Conversation

@isabella-janssen

@isabella-janssen isabella-janssen commented Jul 14, 2026

Copy link
Copy Markdown
Member

- 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

  • Tests
    • Improved validation of machine-count transitions during updates with deadline-based retry logic tailored for layered vs non-layered scenarios.
    • Enhanced handling of transient connection failures by consistently classifying temporary retrieval issues for both controller and node paths.
    • Simplified test setup and tightened transition validation behavior to reduce spurious failures and improve stability.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 14, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@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.

Details

In response to this:

- What I did

- How to verify it

- Description for the changelog

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 openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 14, 2026
@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: facb3151-4f81-44d3-9fa4-28525ccc4720

📥 Commits

Reviewing files that changed from the base of the PR and between da53bae and 8f439d0.

📒 Files selected for processing (1)
  • test/extended/image_mode_status_reporting.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/extended/image_mode_status_reporting.go

Walkthrough

The 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.

Changes

Image mode status reporting

Layer / File(s) Summary
Machine-count transition validation
test/extended/image_mode_status_reporting.go
Simplifies oc initialization, removes the trailing return, and replaces iteration-based machine-count retries with mismatch tracking and layered update deadlines.
Transient connection classification
test/extended/image_mode_status_reporting.go
Uses isTransientConnectionError for MCP and node retrieval failures and removes obsolete errors and syscall imports.

Estimated code review effort: 3 (Moderate) | ~20 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error The new transient/non-transient error logs print raw mcpErr/nodesErr, which can expose internal API hostnames/IPs and other sensitive details. Log only sanitized error categories or redact endpoint details; avoid formatting raw error strings into test logs.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: making the ImageModeStatusReporting MCP count test more resilient on SNO.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All Ginkgo titles in the changed file are static string literals; no dynamic values, timestamps, names, or formatted titles were introduced.
Test Structure And Quality ✅ Passed The PR keeps each It focused, uses deferred cleanup, bounds all cluster waits, and adds failure messages to the new retries.
Microshift Test Compatibility ✅ Passed All added/modified Ginkgo tests are tagged [apigroup:machineconfiguration.openshift.io], so MicroShift CI will skip them.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo tests were added; the existing tests target a single node and fall back to master when worker pools are absent, so no new HA/SNO assumption is introduced.
Topology-Aware Scheduling Compatibility ✅ Passed Only a test file changed; no manifests/controllers or new scheduling constraints were introduced.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes were added: suite init only creates the CLI, and logging goes to GinkgoWriter/logext, not stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only refactors existing test logic; no new Ginkgo blocks, IPv4 literals, host/IP parsing, or external/public internet dependencies were added.
No-Weak-Crypto ✅ Passed Diff only alters test retry/error-handling logic; no MD5/SHA1/DES/RC4/ECB, custom crypto, or secret/token comparisons were added.
Container-Privileges ✅ Passed Only changed file is a Go test; the patch adds no privileged/hostNetwork/hostPID/allowPrivilegeEscalation/SYS_ADMIN settings or K8s manifests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

[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

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 14, 2026
@isabella-janssen isabella-janssen force-pushed the disrutive-suite-stabilization branch from 3cfb394 to da53bae Compare July 14, 2026 16:47
@isabella-janssen

Copy link
Copy Markdown
Member Author

/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

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@isabella-janssen: trigger 3 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • 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

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/b06371a0-7fa3-11f1-8330-cd5287550209-0

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test/extended/image_mode_status_reporting.go (1)

403-446: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Prefer StopTrying(...).Now() over g.Fail() inside the Eventually poll closure.

Calling g.Fail(...) (ginkgo's Fail) from inside the func() bool polled by o.Eventually(...) is non-idiomatic. Gomega ships StopTrying(message).Now() specifically for aborting Eventually/Consistently early with a failure, and its failure message correctly surfaces at the top-level assertion rather than relying on a raw Fail panic unwinding through Gomega's AsyncAssertion internals. 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-minute Eventually timeout rather than being retried — the exact interaction depends on the Gomega/Ginkgo version pinned in go.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

📥 Commits

Reviewing files that changed from the base of the PR and between 63774ee and da53bae.

📒 Files selected for processing (1)
  • test/extended/image_mode_status_reporting.go

@isabella-janssen isabella-janssen force-pushed the disrutive-suite-stabilization branch from d5c0ce6 to 8f439d0 Compare July 14, 2026 17:17
@isabella-janssen

Copy link
Copy Markdown
Member Author

/test verify

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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.

2 participants