← Back to Pull requests

test: stabilize KubernetesClusterDockerTest with readiness probe and rich pod diagnostics #20814

Closed
unknown closed this pull request without merging on Nov 05, 2026 04:55 UTC
View on GitHub
unknown unknown commented on Nov 01, 2026 19:39 UTC
Author

Fixes #20432.

Description

KubernetesClusterDockerTest has intermittently failed in CI (docker-tests) during class setup because K3s pods occasionally failed to become Ready=True within 300 s. When the timeout occurred, K3sClusterResource.waitUntilPodIsReady threw an ISE reporting only the pod name without any diagnostic details (no pod phase, conditions, container states, restart counts, or logs), making it difficult to determine why the pod stalled.

Added readiness probe and tuned heap in manifests/druid-service.yaml


  • Added an HTTP GET /status/health readinessProbe with initialDelaySeconds: 5, periodSeconds: 5, and failureThreshold: 30 to manifests/druid-service.yaml, matching the existing pattern in druid-service-with-operator.yaml. With this probe, Kubernetes sets the pod condition Ready=True only after the Druid service starts and reports healthy, and records Unhealthy warning events if the probe fails.

  • Bumped DRUID_XMX from 128m to 256m in manifests/druid-service.yaml to provide sufficient heap headroom during service initialization on resource-constrained CI runners and prevent OOM/crash restarts.
  • Added synchronization for service pod creation in K3sClusterResource


  • Updated K3sClusterResource.waitUntilPodsAreReady to wait until all expected service pods are created by the Deployment controllers before evaluating readiness conditions, avoiding race conditions where a subset of pods was evaluated before all service pods appeared in the namespace.
  • Added rich diagnostics on pod readiness timeout


  • Updated K3sClusterResource.waitUntilPodIsReady on timeout to query Fabric8 and assemble a detailed diagnostic report in the exception message:

  • - Pod phase and conditions (Ready, ContainersReady, Initialized, PodScheduled) with reasons and messages.
    - Container statuses including ready state, restart count, current state (waiting reason, terminated exit code/reason), and last terminated state (e.g., OOMKilled, exit code 137).
    - Relevant Kubernetes cluster events from client.v1().events() for the pod (e.g. BackOff, Unhealthy, FailedScheduling).
    - Tail of the container log.

    Added pod log dumping for CI artifact collection


  • Added dumpPodLogs in K3sClusterResource to write full pod logs to druid-container-logs/<testClassName>/k3s-pods/<podName>.log upon timeout or health check failure, enabling GitHub Actions CI to archive and upload them as part of the failure-druid-container-logs artifact.
  • Added K3sClusterResourceTest unit tests


  • Added comprehensive unit tests in K3sClusterResourceTest verifying diagnostic formatting across Running, CrashLoopBackOff (with OOMKilled last state), and readiness probe failure scenarios, as well as verifying that manifests/druid-service.yaml generates the expected readinessProbe and heap configuration when processed by K3sDruidService.
  • Release note


    None (internal test and CI stabilization improvement).

    <hr>

    ##### Key changed/added classes in this PR
    K3sClusterResource
    K3sClusterResourceTest
    * manifests/druid-service.yaml

    <hr>

    This PR has:

  • been self-reviewed.

  • added documentation for new or modified features or behaviors.

  • a release note entry in the PR description.

  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.

  • added or updated version, license, or notice information in licenses.yaml

  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.

  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.

  • added integration tests.

  • been tested in a test Druid cluster.
  • Diff: 496 lines (+372 / -124) across 6 files Reviewer: FrankChen021 Review duration: 4876m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.71) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.71 · 496 lines diff across 6 files
    0.71
    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%
    57%
    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.371
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.071
    Real PR Conversation Timeline
    1 comments
    "Review active on #20814"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% reviewed sensitive_module
    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: 70.6% (HIGH) · Higher = larger blast radius
    70.6%
    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: 58.0% · Lower = rushed or shallow review
    58.0%
    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: 29.7% · Safe to merge
    29.7%
    Repository