← Back to Pull requests

perf(test): Reduce compaction tests 12min and Re-sharding test cases to reduce 6min #20307

Closed
unknown closed this pull request without merging on Sep 15, 2026 05:20 UTC
View on GitHub
unknown unknown commented on Sep 09, 2026 15:56 UTC
Author

1. Outcome

  • NativeCompactionTaskRunTest: 22m10s -> 9m51s, saving 12m19s (55.6%), with all 760 active cases preserved.

  • Native + MSQ compaction tests: 24m27s -> 12m03s, saving 12m24s (50.7%), with active coverage unchanged.

  • Slowest main unit-test shard: 33m49s -> 27m25s, saving 6m24s (18.9%).

  • Shard spread: 11m49s -> 5m40s, a 52% reduction.
  • Measured in master CI and the updated CI, using the test Execute step without queue or setup time.

    2. Description

    Class-level parameterization created the full configuration/test Cartesian product before applicability checks. Native discovered 2,016 cases and skipped 1,256 during execution; MSQ discovered 208 and skipped 60. This paid fixture/setup cost for cases that never ran.

    The existing shard layout also assumed N was one of the heaviest groups. Optimizing Native compaction removed most of that weight and left the original layout significantly imbalanced.

    3. Change

  • Select applicable compaction configurations before creating each test invocation.

  • Keep 760 Native and 148 MSQ active cases unchanged.

  • Use reusable per-test selections for Native and MSQ scenarios.

  • Rebalance the main unit tests into nine letter buckets.

  • Exclude separately sharded QTest reports from the main-shard balancing input.
  • 4. Why Resharding

    With the compaction optimization but the original shard layout, N fell from 33m49s to 20m30s, while the slowest shard still took 34m22s. The resulting 13m52s spread meant the saved compaction time did not reduce the CI critical path.

    The final layout reduces the slowest shard to 27m25s and the spread to 5m40s. The intermediate result with the original layout is available in this workflow.

    Diff: 237 lines (+177 / -60) across 2 files Reviewer: GWphua Review duration: 8003m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 237 lines diff across 2 files
    0.37
    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.327
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #20307"
    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: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    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: 14.7% · Safe to merge
    14.7%
    Repository