← Back to Pull requests

snr: add control plane isolation regression test (RHWA-1927) #93

Open
razo7 opened this pull request with 425 lines diff across 5 files
View on GitHub
razo7 razo7 commented on Oct 29, 2026 16:00 UTC
Author

Dependencies

✅ CI test dependency resolved: openshift/release#88299 (merged) added the injector image configuration for connected SNR e2e jobs; the earlier failing attempt was #88164. The probe no longer relies on that image for pgrep — the agent PID discovery was rewritten to scan /proc//cmdline directly, so ubi9/ubi (which ships nsenter and iptables but not pgrep) is now sufficient. Disconnected jobs skip gracefully at the usability probe.

What

Adds the RHWA-1927 system test for the control plane isolation gate that fixes RHWA-1384: a control plane node whose local kube-apiserver still answers /readyz with 200, but whose SNR agent cannot reach any peer, must stop feeding the watchdog and reboot itself. Before the fix the passing /readyz reset the error count every tick and the node fed its watchdog forever.

Builds on @weshayutin's original test (#60) and folds in the subsequent review fixes, so it supersedes #60.

How it works

The test rejects traffic on the SNR peer health port inside the victim agent's network namespace (the agent sets hostPID but not hostNetwork, so host-level iptables would never match its peer traffic), leaving the kube-apiserver connection untouched so /readyz keeps returning 200. It then captures the agent isolation log in one pre-reboot snapshot and asserts the node reboots within the RHWA-1384 budget, with no NHC-created SelfNodeRemediation CR and without the peer masters rebooting. Any NodeHealthCheck that selects control plane nodes is neutralized (selector patched to never-match) for the duration of the test and restored in DeferCleanup.

Review fixes included

  • IsNotFound on the SelfNodeRemediation CR check, so a timeout or server error cannot pass the assertion.

  • Single pre-reboot log snapshot instead of three sequential reads, so a fast reboot cannot wipe the earlier messages before they are observed.

  • Selector-based (not substring) NodeHealthCheck control-plane detection, with neutralization instead of skip — NHC CRs that select control plane nodes are patched to a never-match selector for the test duration and restored via DeferCleanup.

  • Propagated NodeHealthCheck list errors; only an absent NHC CRD counts as "no NHC".

  • De-duplicated labels.DisruptionDestructive.

  • Reads injector image from ${SHARED_DIR}/injector_image file (Prow CI integration).

  • Uses tryRunHostCommandPod for the usability probe so a stuck Pending pod returns a skip instead of a hard FAIL.

  • Agent PID discovery uses /proc//cmdline scan instead of pgrep -f, eliminating the dependency on a debug image that carries pgrep.
  • Test plan

  • make fmt && make lint && make check-testcase pass.

  • Destructive, nightly resiliency tier. Requires a cluster with 3+ Ready masters and a functional watchdog; one master is isolated and hard-reboots itself.

  • Standalone: SNR_INJECTOR_IMAGE=registry.access.redhat.com/ubi9/ubi:latest ginkgo --label-filter="snr" --focus="isolated from its SNR peers" ./tests/snr-operator/... (the injector image must carry nsenter and iptables; pgrep is no longer required)
  • Diff: 425 lines (+318 / -107) across 5 files Reviewer: abrugaro Review duration: 53316m
    All Vouch review confidence checks passed
    Residual risk 0.29 = Change Risk (0.52) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 425 lines diff across 5 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    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.362
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #93"
    general weight: 0.35
    Reviewers
    Assignees
    razo7 razo7
    Labels
    risk: low confidence: 44.7% 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: 52.1% (MEDIUM) · Higher = larger blast radius
    52.1%
    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: 44.7% · Lower = rushed or shallow review
    44.7%
    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: 28.8% · Safe to merge
    28.8%