Skip to content

Systematically reduce UT Testing job wall time without weakening coverage #27705

Closed

Description

@XuPeng-SH

Problem

The UT Testing job on run 33027514878 / job 98372273909 took 63m48s wall time. The make ut portion took 61m43.659s while using only about 3.73 aggregate CPU cores on an 8-core runner.

Measured critical path:

Phase Wall time
Native/third-party/CGo preparation 5m03s
Smoke/preparation 28s
Light race packages 18m56s
Exclusive race packages 14m43s
Embedded-cluster race packages 10m24s
Resource-heavy + engine shards 8m43s
Plan build/discovery/tests 2m48s
Report analysis 39s

The runner already receives UT_PARALLEL=8, but native dependencies and CGo are still built serially before tests. The analyzed job spent about 4m22s in third-party compilation and another 33s in CGo compilation.

The same job reached about 17.18 GB cgroup peak memory with memory.events max=9, so increasing race-test concurrency globally is unsafe.

Goal

Systematically reduce UT wall time without changing:

  • test inventory or package selection;
  • race detector coverage or repetition;
  • coverage collection and reporting;
  • assertions, fixtures, timeouts, or product behavior;
  • serialized admission required by embedded clusters and fixed-port tests.

Work plan

  1. Reuse the explicit UT CPU budget for native compilation before race tests start.
  2. Remove duplicated setup/report work where the owning CI contract permits.
  3. Reclaim idle slots only in phases with measured memory headroom and deterministic cancellation/report merging.
  4. Optimize repeated expensive fixtures only with an explicit oracle/coverage map; do not merge non-orthogonal scenarios or add t.Parallel to shared mutable fixtures.
  5. Validate each slice with same-commit A/B wall time, exact test/race/coverage equivalence, and cgroup memory evidence.

First-slice evidence

On the same commit and machine, a clean native build changed from 80.43s serial to 18.92s and 17.75s with bounded parallelism. Serial and parallel libmo.so / libmo.a hashes are identical, forced build failures still propagate, and CGo-direct/transitive link tests pass.

Activity

  1. XuPeng-SH commented on Aug 27, 2026

    @XuPeng-SH
    ContributorAuthor

    First optimization slice is available in #27706. It parallelizes native third-party/CGo preparation using the existing UT CPU budget and adds an opt-in to avoid duplicate package-graph verification. The companion workflow change is matrixorigin/CI#433.

    Measured same-commit native A/B: 80.43s serial -> 18.92s / 17.75s parallel, with identical libmo hashes and passing CGo link tests. The config de-duplication removes an additional measured 28.158s while retaining the separately timed proxy canary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions