← Back to Pull requests

nmo-operator: add NHC-NMO node lease interop test (RHWA-1255) #140

Open
gamado opened this pull request with 1484 lines diff across 9 files
View on GitHub
gamado gamado commented on Nov 16, 2026 16:53 UTC
Author

Merge order: this PR's spec only runs in CI on the e2e-interop lane from openshift/release#89450 (NHC + NMO + ssh-bastion installed together); until that lane lands the spec skips everywhere, so ideally it merges once the lane can run it via /test 5.0-konflux-e2e-interop-aws. The sibling PR #141 (OCP-65652) already merged; this PR is rebased on top of it and dedups the shared lease helpers (see the rebase note below).

Port of OCP-65651 test_nmo_node_lease_on_worker from ocp-edge-auto (RHWA-1255, PR 1 of 4).

What it verifies

While a worker is under NMO maintenance -- so NMO holds the node's lease in medik8s-leases -- NHC must not start remediating it. Kubelet is stopped on the worker via SSH and for a 63s window the spec asserts all three invariants: NHC stays Enabled, the lease holder stays node-maintenance, and no TestRemediation CR is created. Deleting the NodeMaintenance CR hands the lease over: NHC reaches Remediating within the same window, creates the node's TestRemediation CR, and becomes the lease holder (NodeHealthCheck-nhc-node-lease-test). Restarting kubelet ends the remediation: the node returns to Ready, NHC returns to Enabled, and the node's lease is released. The hand-over half is the positive control proving the negative window is not vacuous: the same node, with kubelet still down, does get remediated once maintenance ends. Maintenance blocks remediation both through the lease and through the exclude-from-remediation label NMO sets; both are removed at hand-over, so the window shows NMO maintenance as a whole blocking remediation, with the lease as the mechanism under test.

  • Test plan: OCP-65651

  • Jira: RHWA-1255

  • Test case document: [docs/TESTCASES/rhwa-1255.md](docs/TESTCASES/rhwa-1255.md)

  • The NHC CR uses the TestRemediation dummy remediator, as the Python reference and the NHC suite's merged specs do (not the Polarion plan's SNRT template).
  • Verification

    Validated on a live cluster (OCP 5.0.2, AWS, 3 control-plane + 3 workers, NMO+NHC+SNR v5.8.0 from the GA catalog, kubelet stop/start over SSH via the local bastion):

  • The spec passes end to end (2m35s), including the new assertions from the self-review round: the node's TestRemediation CR is created in the hand-over, and pre-existing NodeHealthCheck CRs are snapshotted, deleted for the duration, and restored on teardown.

  • The NHC lease-holder identity format NodeHealthCheck-<CR name> is confirmed against live NHC v5.8 (the substring match in the hand-over assertion passes against the observed holder).

  • Observed hand-over latency (NodeMaintenance deletion to NHC Remediating): 765ms, versus the 63s window -- no retry-backoff concern.

  • Cluster state verified clean after the run: all nodes Ready, no NodeMaintenance CRs, no leases in medik8s-leases, TestRemediation fixture CRDs and RBAC fully removed.
  • Self-review (3-agent review-checklist pass) findings are addressed in this PR: skip guards moved ahead of any cluster mutation, NHC snapshot/restore, unconditional kubelet restart in cleanup whenever the spec attempted the stop, reboot-scale failure-path recovery budget, surfaced cleanup results as report entries, teardown limited to fixture objects this run created, per-node lease-release assertion, and reuse of the suite's shared helpers.

    CI dependency (blocking)

    This spec is labelled tier:interop and needs NHC and NMO installed together plus the ssh-bastion step. The regular lanes exclude tier:interop, so the spec runs nowhere in existing CI jobs; the interop lane that covers it is openshift/release#89450 (renames the far-nhc-interop presubmit to 5.0-konflux-e2e-interop-aws with far+nhc+nmo installed together and a tier:interop label filter). Once that merges, /test 5.0-konflux-e2e-interop-aws exercises this spec in CI. Until then the spec's validation is the live-cluster run below; in the existing NMO lane it skips by design (NHC not installed).

    Status

    Live-cluster validation and self-review are done. Reviews are welcome now. The WIP label has been removed early to unblock review; the hard gate is the merge order below -- merging still waits for openshift/release#89450 and a green /test 5.0-konflux-e2e-interop-aws run. The other three lease tests (OCP-65652, OCP-66801, OCP-66800) follow in separate PRs.

    🤖 Generated with Claude Code

    Diff: 1484 lines (+1125 / -359) across 9 files Reviewer: frajamomo Review duration: 27343m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.55) × (1 − Review Confidence (0.52)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 1484 lines diff across 9 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.14 · 1 substantive comment(s)
    0.14
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    51%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Shallow Review Depth shallow_review_depth
    0.301
    Real PR Conversation Timeline
    1 comments
    "Review active on #140"
    general weight: 0.35
    Reviewers
    Assignees
    gamado gamado
    Labels
    risk: low confidence: 51.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.7% (MEDIUM) · Higher = larger blast radius
    54.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 51.5% · Lower = rushed or shallow review
    51.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.5% · Safe to merge
    26.5%