← Back to Pull requests

test(e2e): keep the mHSM etcd test to creation coverage (AROSLSRE-2746) #8016

Closed
unknown closed this pull request without merging on Nov 10, 2026 01:45 UTC
View on GitHub
unknown unknown commented on Nov 09, 2026 22:07 UTC
Author

Jira: AROSLSRE-2746

What

  • test/e2e/cluster_etcd_mhsm.go keeps cluster creation, the stored keyVaultType assertion, admin credentials and the cluster viability check with the mHSM key.

  • The test no longer creates a second mHSM key version, rotates ActiveKey.Version, performs the post-rotation round-trip GET, or verifies re-encryption and post-rotation viability.

  • The It name becomes should create a cluster with Managed HSM keyVaultType.
  • Why

    The rotation is an UpdateHCPCluster20261001 LRO that waits for etcd re-encryption against the mHSM key. Measured in run 2119876572646215680, while the test passed:

    | Phase | Minutes |
    |---|---:|
    | Rotation LRO | 17.0 |
    | Cluster create | 10.3 |
    | Managed HSM deploy and activation | 14.4 |
    | Cleanup | 19.1 |
    | Test total | 61.5 |

    That is 28% of the test spent in one control-plane LRO. Key rotation and etcd re-encryption are already covered twice by test/e2e/kms_key_rotation.go, including VerifyStorageVersionMigrationSucceeded after each rotation, for Key Vault backed clusters. This test's unique value is the ManagedHSM keyVaultType and a working etcd encrypted with an mHSM key, both of which remain.

    Rotation coverage already exists

    test/e2e/kms_key_rotation.go runs Customer should be able to rotate KMS key for a cluster with version >= 4.22 (labels RequireNothing, High, Positive, AroRpApiCompatible, Slow). It rotates the customer Key Vault KMS key twice, and after each rotation it:

    1. creates a new key version in the customer Key Vault and patches Etcd.DataEncryption.CustomerManaged.Kms.ActiveKey.Version through an UpdateHCPCluster call bounded by HCPClusterReencryptionUpgradeTimeout;
    2. asserts the update response references the new key version;
    3. re-reads the cluster and asserts the new version round-trips;
    4. waits for VerifyStorageVersionMigrationSucceeded, which is the etcd re-encryption check;
    5. disables the previous key version and asserts the cluster stays functional with the same verifier again.

    That test rotates through UpdateHCPCluster20260901 (v20260901preview), while this test rotates through v20261001, so the assertion shape is the same but the API version is not. The RP rotation behaviour, including the re-encryption wait, stays covered twice. Two things are genuinely lost: mHSM key rotation, and rotation through the v20261001 update path. What remains here is the mHSM key source on the creation path, which still creates an mHSM key version and verifies etcd works against it. The trade is deliberate and recorded in the ticket.

    Testing

    go build -tags E2Etests ./e2e/...
    go vet -tags E2Etests ./e2e/...
    

    Pass, and gofmt is clean.

    Live validation: integration-e2e-parallel-all on this PR, run 2119935169262522368. The suite finished successfully and the test passed under its new name.

    | Measured | Before | After |
    |---|---:|---:|
    | Setup and test execution | 42.7 min | 28.3 min |
    | Cleanup | 19.1 min | 22.4 min |
    | Test total | 61.5 min | 50.6 min |

    The step list no longer contains the rotation, the post-rotation round-trip GET, the re-encryption verification or the post-rotation viability check, and the 17.0-minute rotation LRO is absent. Cleanup moved by 3.3 minutes between the two runs, so the total understates the removed phase; the step list is the signal.

    Special notes for your reviewer

    This is a deliberate coverage reduction, not a refactor. Managed HSM key rotation is no longer covered by any test; Key Vault backed rotation and re-encryption stay covered by kms_key_rotation.go. If mHSM rotation coverage is wanted later, it belongs in a separate test that owns the rotation instead of appending it to the creation test.

    PR Checklist

  • PR is scoped to a single task (no mixed concerns)

  • Title follows Conventional Commits format

  • Summary explains the "Why" behind the change

  • Linked to relevant ticket/issue

  • Screenshots included (if dashboards or other UI changes)

  • Self-reviewed the diff

  • CI/CD checks are passing (ignore Tide)

  • Draft PR used for WIP (if applicable)

  • Commit history is clean (rebased/squashed)

  • Tricky code blocks are commented

  • Specific reviewers tagged

  • All comment threads resolved before merge
  • Diff: 594 lines (+445 / -149) across 7 files Reviewer: cadenmarchese Review duration: 218m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 594 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.382
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #8016"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.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: 50% (MEDIUM) · Higher = larger blast radius
    50%
    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: 60.5% · Lower = rushed or shallow review
    60.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: 19.8% · Safe to merge
    19.8%
    Repository