Skip to content

OCPBUGS-85782: Add extra wait after mco and cvo considers upgrade complete#31289

Open
xueqzhan wants to merge 1 commit into
openshift:mainfrom
xueqzhan:wait-after-upgrade
Open

OCPBUGS-85782: Add extra wait after mco and cvo considers upgrade complete#31289
xueqzhan wants to merge 1 commit into
openshift:mainfrom
xueqzhan:wait-after-upgrade

Conversation

@xueqzhan

@xueqzhan xueqzhan commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This is due to the fact that MCO does not wait for worker pool before declaring upgrade complete. So when the remaining tests started running, some daemonset were still not ready.

Summary by CodeRabbit

  • Tests
    • Improved cluster upgrade testing with enhanced stability verification between upgrade steps. The upgrade testing process now validates cluster readiness rather than using fixed wait times. Better error handling logs stability check delays as warnings instead of causing test failures, providing improved visibility into cluster state and ensuring more reliable upgrade operations.

This is due to the fact that MCO does not wait for worker pool before
declaring upgrade complete. So when the remaining tests started running,
some daemonset were still not ready.
@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: automatic mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jun 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@xueqzhan: This pull request references Jira Issue OCPBUGS-85782, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This is due to the fact that MCO does not wait for worker pool before declaring upgrade complete. So when the remaining tests started running, some daemonset were still not ready.

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.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Walkthrough

E2E upgrade test suite now imports a cluster info utility and replaces a fixed 5-second sleep after upgrade steps with an active wait for cluster stabilization. If stabilization times out or fails, the test logs a warning instead of failing, improving test robustness.

Changes

Upgrade Cluster Stabilization

Layer / File(s) Summary
Cluster stabilization wait after upgrade
test/e2e/upgrade/upgrade.go
Import clusterinfo and replace the unconditional 5-second sleep with clusterinfo.WaitForStableCluster. If stabilization times out or errors, the code logs a WARNING instead of failing the test.

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning Two assertions in the test file lack meaningful failure messages: line 156 (o.Expect(err).NotTo(o.HaveOccurred())) and line 171 lack context-specific messages that would help diagnose failures. Add failure messages to assertions on lines 156 and 171, e.g., o.Expect(err).NotTo(o.HaveOccurred(), "failed to list nodes") and o.Expect(combinedErr).NotTo(o.HaveOccurred(), "some nodes not ready").
✅ 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 directly references the issue (OCPBUGS-85782) and accurately summarizes the main change: adding an extra wait after MCO and CVO consider upgrade complete, which aligns with the code change that replaces a fixed sleep with a cluster stability check.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 test names in the modified file are stable and deterministic, containing no dynamic values like timestamps, UUIDs, node/pod/namespace names, or IP addresses. Test names are descriptive a...
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. The change only modifies an existing test by replacing a 5-second sleep with clusterinfo.WaitForStableCluster(). The custom check only applies to new t...
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo tests are added; the PR only modifies an existing test's upgrade wait logic with a cluster stabilization check that properly handles non-OpenShift clusters (MicroShift).
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only test/e2e/upgrade/upgrade.go, adding a cluster stability check via clusterinfo.WaitForStableCluster. This is test infrastructure that polls ClusterOperator conditions, not a deploym...
Ote Binary Stdout Contract ✅ Passed All logging statements (framework.Logf) are within g.It() test blocks, not process-level code. WaitForStableCluster returns structured JUnit results without stdout writes. No stdout contract violat...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add new Ginkgo e2e tests; it only modifies an existing test by replacing a sleep with a clusterinfo.WaitForStableCluster call. The check only applies to new test definitions, so it...
No-Weak-Crypto ✅ Passed The PR modifies upgrade test code to add a cluster stabilization wait. No weak cryptography (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or non-constant-time secret co...
Container-Privileges ✅ Passed PR only modifies test/e2e/upgrade/upgrade.go, a Go test file with no K8s manifests. No container privilege configurations exist in this change.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds logging of ClusterOperator names and status conditions, which are standard, non-sensitive cluster state information. No passwords, tokens, API keys, PII, session IDs, internal hostnames...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci-robot

Copy link
Copy Markdown

@xueqzhan: This pull request references Jira Issue OCPBUGS-85782, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

This is due to the fact that MCO does not wait for worker pool before declaring upgrade complete. So when the remaining tests started running, some daemonset were still not ready.

Summary by CodeRabbit

  • Tests
  • Improved cluster upgrade testing with enhanced stability verification between upgrade steps. The upgrade testing process now validates cluster readiness rather than using fixed wait times. Better error handling logs stability check delays as warnings instead of causing test failures, providing improved visibility into cluster state and ensuring more reliable upgrade operations.

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 requested review from p0lyn0mial and sjenning June 11, 2026 13:12
@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xueqzhan

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 Jun 11, 2026

@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/e2e/upgrade/upgrade.go (1)

196-203: ⚡ Quick win

Post-upgrade stabilization wait looks good.

The approach of waiting for cluster stability with WaitForStableCluster after upgrade completion addresses the issue where MCO reports success before worker nodes finish rebooting and workloads restart. Logging a warning on timeout without failing the test is appropriate and matches the existing pattern shown in pkg/test/ginkgo/cmd_runsuite.go.

💡 Optional: Capture detailed failure information for better diagnostics

The discarded JUnit test cases (first return value) contain detailed information about which cluster operators failed to stabilize, recovery status, and timing. While the current "warning only" approach is reasonable, capturing and logging these details would provide better diagnostics for intermittent issues:

-				if _, waitErr := clusterinfo.WaitForStableCluster(context.Background(), config); waitErr != nil {
-					framework.Logf("WARNING: cluster did not stabilize within timeout after upgrade: %v", waitErr)
+				if testCases, waitErr := clusterinfo.WaitForStableCluster(context.Background(), config); waitErr != nil {
+					msg := fmt.Sprintf("WARNING: cluster did not stabilize within timeout after upgrade: %v", waitErr)
+					for _, tc := range testCases {
+						if tc.FailureOutput != nil {
+							msg += fmt.Sprintf("\n%s", tc.FailureOutput.Output)
+						}
+					}
+					framework.Logf("%s", msg)
 				}

Based on learnings from Context snippet 1, the test cases include summaries of unstable operators that never recovered and those that recovered with timing information.

🤖 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/e2e/upgrade/upgrade.go` around lines 196 - 203, The test currently calls
clusterinfo.WaitForStableCluster and discards the first return value (the
detailed JUnit test cases); update the call to capture both returns (e.g.,
tests, waitErr := clusterinfo.WaitForStableCluster(...)) and when waitErr != nil
log the detailed test case summaries (tests or their summaries) along with the
existing warning so diagnostic info about which cluster operators failed or
recovered is preserved; ensure you reference the existing framework.Logf call to
emit those details and keep the test behavior (not failing) unchanged.
🤖 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/e2e/upgrade/upgrade.go`:
- Around line 196-203: The test currently calls clusterinfo.WaitForStableCluster
and discards the first return value (the detailed JUnit test cases); update the
call to capture both returns (e.g., tests, waitErr :=
clusterinfo.WaitForStableCluster(...)) and when waitErr != nil log the detailed
test case summaries (tests or their summaries) along with the existing warning
so diagnostic info about which cluster operators failed or recovered is
preserved; ensure you reference the existing framework.Logf call to emit those
details and keep the test behavior (not failing) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 468798ef-3681-45c7-a485-9aa2d1a36c47

📥 Commits

Reviewing files that changed from the base of the PR and between bde16f5 and 74903bf.

📒 Files selected for processing (1)
  • test/e2e/upgrade/upgrade.go

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn-upgrade-rollback

@xueqzhan

Copy link
Copy Markdown
Contributor Author

/retest-required

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@xueqzhan: The following tests 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/e2e-vsphere-ovn 74903bf link true /test e2e-vsphere-ovn
ci/prow/e2e-gcp-ovn-upgrade 74903bf link true /test e2e-gcp-ovn-upgrade
ci/prow/e2e-metal-ipi-ovn-ipv6 74903bf link true /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-aws-ovn-microshift-serial 74903bf link true /test e2e-aws-ovn-microshift-serial
ci/prow/e2e-aws-ovn-serial-1of2 74903bf link true /test e2e-aws-ovn-serial-1of2
ci/prow/e2e-gcp-ovn 74903bf link true /test e2e-gcp-ovn
ci/prow/e2e-aws-ovn-microshift 74903bf link true /test e2e-aws-ovn-microshift
ci/prow/e2e-aws-ovn-fips 74903bf link true /test e2e-aws-ovn-fips
ci/prow/e2e-aws-ovn-upgrade-rollback 74903bf link false /test e2e-aws-ovn-upgrade-rollback
ci/prow/e2e-aws-ovn-serial-2of2 74903bf link true /test e2e-aws-ovn-serial-2of2
ci/prow/e2e-vsphere-ovn-upi 74903bf link true /test e2e-vsphere-ovn-upi

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.

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. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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