Skip to content

OCPEDGE-2827: tolerate one NotReady CP node in EnsureNodesReady for degraded TNF - #31442

Open
Neilhamza wants to merge 1 commit into
openshift:mainfrom
Neilhamza:fix/ensure-nodes-ready-degraded-tnf
Open

OCPEDGE-2827: tolerate one NotReady CP node in EnsureNodesReady for degraded TNF#31442
Neilhamza wants to merge 1 commit into
openshift:mainfrom
Neilhamza:fix/ensure-nodes-ready-degraded-tnf

Conversation

@Neilhamza

@Neilhamza Neilhamza commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

On intentionally degraded Two Node Fencing (TNF) clusters where one master is shut down, EnsureNodesReady in BeforeEach hooks blocks all 13 test files under test/extended/node/ because it fails on any NotReady node with no bypass.

This change adds a targeted carve-out: when DEGRADED_NODE=true (already wired via PR #30649) AND the cluster topology is DualReplica (TNF), tolerate exactly one NotReady control-plane node. This follows the same ClusterDegraded && IsTwoNodeFencing() pattern used in test/extended/operators/certs.go.

The check remains strict for non-degraded clusters, non-TNF topologies, multiple NotReady nodes, and NotReady worker nodes.

Why not skip the tests?

Adding tests to TEST_SKIPS requires maintenance as new tests are added to the 13 affected files. Since all 13 files funnel through EnsureNodesReady, fixing the single choke point automatically covers future tests.

Failing CI lanes

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-degraded
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-dualstack-degraded

Jira: https://redhat.atlassian.net/browse/OCPEDGE-2827

Summary by CodeRabbit

  • Bug Fixes
    • Improved cluster readiness handling for degraded two-node clusters.
    • When two-node fencing is enabled, readiness checks now tolerate exactly one NotReady control-plane/master node and continue instead of failing.
    • Any other NotReady-node scenario still results in a test failure to maintain strict validation.

@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 the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 28, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@Neilhamza: This pull request references OCPEDGE-2827 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

On intentionally degraded Two Node Fencing (TNF) clusters where one master is shut down, EnsureNodesReady in BeforeEach hooks blocks all 13 test files under test/extended/node/ because it fails on any NotReady node with no bypass.

This change adds a targeted carve-out: when DEGRADED_NODE=true (already wired via PR #30649) AND the cluster topology is DualReplica (TNF), tolerate exactly one NotReady control-plane node. This follows the same ClusterDegraded && IsTwoNodeFencing() pattern used in test/extended/operators/certs.go.

The check remains strict for non-degraded clusters, non-TNF topologies, multiple NotReady nodes, and NotReady worker nodes.

Why not skip the tests?

Adding tests to TEST_SKIPS requires maintenance as new tests are added to the 13 affected files. Since all 13 files funnel through EnsureNodesReady, fixing the single choke point automatically covers future tests.

Failing CI lanes

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-degraded
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-dualstack-degraded

Jira: https://redhat.atlassian.net/browse/OCPEDGE-2827

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 Jul 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 30d07d3a-f52c-4325-a1fc-c1bee1324c33

📥 Commits

Reviewing files that changed from the base of the PR and between 37eeb67 and 9713c89.

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

Walkthrough

EnsureNodesReady directly evaluates NotReady nodes and permits one control-plane or master-labeled node when the cluster is degraded and two-node fencing is enabled. Other NotReady conditions continue to fail readiness checks.

Changes

Node readiness handling

Layer / File(s) Summary
Degraded control-plane readiness exception
test/extended/node/node_utils.go
EnsureNodesReady lists nodes directly, applies the degraded two-node fencing exception, and uses hasControlPlaneLabel to recognize control-plane and master labels.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: mrunalp, sairameshv, bhargavigudi


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error New framework.Logf prints a control-plane node name, which can expose an internal hostname in degraded TNF runs. Remove or redact the node identifier from the log; keep only non-identifying state like count/role.
✅ 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: tolerating one NotReady control-plane node in EnsureNodesReady for degraded TNF clusters.
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 Touched file only changes node-readiness helper code; no It/Describe/Context/When titles were added or modified.
Test Structure And Quality ✅ Passed Only node_utils.go changed; no Ginkgo It blocks/resources/timeouts were added, and the new helper uses clear Expect messages and matches existing degraded-TNF pattern.
Microshift Test Compatibility ✅ Passed PASS — This PR only changes test helper logic in node_utils.go; no new Ginkgo specs were added, so the MicroShift compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo tests were added; the PR only updates EnsureNodesReady helper logic, so there are no new SNO-specific multi-node assumptions to flag.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The only modified file is a test helper under test/extended/node; it only relaxes readiness checks for degraded TNF clusters and adds no pod scheduling constraints.
Ote Binary Stdout Contract ✅ Passed PASS: The PR only changes a helper in node_utils.go; no main/init/TestMain/BeforeSuite/RunSpecs code or stdout writers were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only EnsureNodesReady helper logic changed; no new Ginkgo tests, IP literals, or external connectivity were added.
No-Weak-Crypto ✅ Passed Touched code only changes node readiness logic and helper labels; bounded searches found no weak-crypto APIs or secret/token comparisons.
Container-Privileges ✅ Passed PR only changes a Go test helper; the diff adds no container/K8s manifests or privileged, hostPID/hostNetwork/hostIPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
✨ 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 requested review from mrunalp and sairameshv July 28, 2026 16:52
@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Neilhamza
Once this PR has been reviewed and has the lgtm label, please assign cpmeadors for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

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

Actionable comments posted: 1

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

Inline comments:
In `@test/extended/node/node_utils.go`:
- Around line 1006-1009: Update isControlPlaneNode to return (bool, error),
preserving the classification result while propagating failures from the
Nodes().Get lookup instead of converting them to false. Update EnsureNodesReady
and all callers to handle and assert the returned error so API lookup failures
are reported distinctly from a NotReady node.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 573730f8-9b15-4f19-ae06-966c3ffb9ad1

📥 Commits

Reviewing files that changed from the base of the PR and between 203a39d and 5df8d5b.

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

Comment thread test/extended/node/node_utils.go Outdated
Comment on lines +1006 to +1009
func isControlPlaneNode(ctx context.Context, oc *exutil.CLI, nodeName string) bool {
node, err := oc.AdminKubeClient().CoreV1().Nodes().Get(ctx, nodeName, metav1.GetOptions{})
if err != nil {
return false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Propagate the node lookup error.

Line [1007] can fail, but Line [1008] silently converts that failure into false. A transient API error will then fall through to the readiness assertion and be reported as a NotReady node instead of an inability to classify it. Return (bool, error) and propagate/assert the error from EnsureNodesReady, or reuse the node returned by the initial list.

🤖 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/node/node_utils.go` around lines 1006 - 1009, Update
isControlPlaneNode to return (bool, error), preserving the classification result
while propagating failures from the Nodes().Get lookup instead of converting
them to false. Update EnsureNodesReady and all callers to handle and assert the
returned error so API lookup failures are reported distinctly from a NotReady
node.

Source: Path instructions

@Neilhamza
Neilhamza force-pushed the fix/ensure-nodes-ready-degraded-tnf branch from 5df8d5b to 37eeb67 Compare July 28, 2026 16:56
@Neilhamza

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-nightly-4.23-e2e-metal-ovn-two-node-fencing-degraded 5

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@Neilhamza: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.23-e2e-metal-ovn-two-node-fencing-degraded

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/8e038bb0-8aa5-11f1-9537-77918f9bbb03-0

@Neilhamza

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn 5

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@Neilhamza: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/04a6a3b0-8aa6-11f1-9fe7-da6c8b8c8de2-0

@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

@Neilhamza

Copy link
Copy Markdown
Contributor Author

/retest

@Neilhamza

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-nightly-4.23-e2e-metal-ovn-two-node-fencing-degraded 5

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@Neilhamza: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.23-e2e-metal-ovn-two-node-fencing-degraded

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/f4990ee0-8b1d-11f1-9b3a-26d65f39e96e-0

@Neilhamza

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn 5

@Neilhamza

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@Neilhamza: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/fa2112e0-8b1d-11f1-8f1b-d09c5195f877-0

@Neilhamza

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn 5

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@Neilhamza: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/9d156510-8b22-11f1-9ddd-15883f653acd-0

…egraded TNF

EnsureNodesReady checks that all nodes are Ready before running tests.
On intentionally degraded Two Node Fencing clusters (one master shut
down), this blocks every test suite that uses the check (13 files).

When DEGRADED_NODE=true (sets exutil.ClusterDegraded) and the cluster
topology is DualReplica (TNF), tolerate exactly one NotReady node if
it is a control-plane node. This follows the same pattern established
in PR#30649 for cert collection on degraded clusters.

The check remains strict for:
- Non-degraded clusters (no env var)
- Non-TNF topologies
- More than one NotReady node
- NotReady worker nodes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Neilhamza
Neilhamza force-pushed the fix/ensure-nodes-ready-degraded-tnf branch from 37eeb67 to 9713c89 Compare July 29, 2026 07:56
@Neilhamza

Copy link
Copy Markdown
Contributor Author

@coderabbitai perform full review

@openshift-ci-robot

Copy link
Copy Markdown

@Neilhamza: This pull request references OCPEDGE-2827 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 story to target either version "5.0." or "openshift-5.0.", but it targets "openshift-4.23" instead.

Details

In response to this:

Summary

On intentionally degraded Two Node Fencing (TNF) clusters where one master is shut down, EnsureNodesReady in BeforeEach hooks blocks all 13 test files under test/extended/node/ because it fails on any NotReady node with no bypass.

This change adds a targeted carve-out: when DEGRADED_NODE=true (already wired via PR #30649) AND the cluster topology is DualReplica (TNF), tolerate exactly one NotReady control-plane node. This follows the same ClusterDegraded && IsTwoNodeFencing() pattern used in test/extended/operators/certs.go.

The check remains strict for non-degraded clusters, non-TNF topologies, multiple NotReady nodes, and NotReady worker nodes.

Why not skip the tests?

Adding tests to TEST_SKIPS requires maintenance as new tests are added to the 13 affected files. Since all 13 files funnel through EnsureNodesReady, fixing the single choke point automatically covers future tests.

Failing CI lanes

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-degraded
  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-dualstack-degraded

Jira: https://redhat.atlassian.net/browse/OCPEDGE-2827

Summary by CodeRabbit

  • Bug Fixes
  • Improved cluster readiness handling for degraded two-node clusters.
  • When two-node fencing is enabled, readiness checks now tolerate exactly one NotReady control-plane/master node and continue instead of failing.
  • Any other NotReady-node scenario still results in a test failure to maintain strict validation.

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 Jul 29, 2026

Copy link
Copy Markdown

@Neilhamza: Starting a full review of the pull request, including the degraded Two Node Fencing readiness exception and its surrounding behavior.

Action performed

Full review triggered.

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

Labels

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