morningman opened a new pull request, #71419:
URL: https://github.com/apache/doris/pull/71419
### Background
The BE unit-test script uses `-j N` to build the test binary with N jobs.
With `--run`, GoogleTest previously ran all selected tests in one process. The
BE CI wrapper starts the test binary directly.
### What problem does this PR solve?
Issue Number: #71314
Related PR: #71381 (isolates process-wide test state), #71389 (adds the
compile benchmark entry point)
PR Type: Performance
Problem Summary:
A full local BE test run serializes suites that can run independently. With
`--run -j N` for N greater than one, the script schedules whole suites across
worker processes. The workers isolate writable paths and produce a merged
GoogleTest report. Fixture fixes remove dependencies on fixed ports, shared
paths and state established by earlier tests.
### Details
- **Change map:** Build tooling and its synthetic tests add 1,618 lines and
remove 5. BE fixtures add 176 lines and remove 64. Three BE source files add 30
lines and remove 37.
- The runner enumerates tests, schedules batches with a memory budget,
recovers unstarted tests when a batch stops, and merges XML. Its synthetic
suite covers scheduling, failure paths and output.
- The fixture changes isolate paths and ports, restore file-cache,
compaction and buffer settings, and account for ARM64 stack capture, Debian's
shell and the TLS signal policy. Python UDF tests use the runner's private
socket directory.
- Packed-file metric writes leave window sampling to the bvar collector.
The fixture checks the samples it adds to the cumulative recorders.
- **Why it was slow:** All suites occupied a single test process even when
the build and the machine could use several cores.
- **Optimization:** Batch suites using their recorded time and peak memory.
Cap the number of workers by `-j`, with private working directories and per-run
logs. Record crashes, timeouts and missing tests in the merged report.
- **Results:** Earlier ASAN measurements on an 18-core Apple M5 Pro with
Clang 22.1.8 put the median full command at 2,661.1 seconds in serial (two
runs) and 390.6 seconds at six workers (three runs), a 6.8× speedup. The
measurements predate the PR split. The current Linux runs are functional checks.
- **Applicability and cost:** The first full run learns each suite's memory
use in a separate process. Later runs combine suites. Parallel tests use more
memory and retain a log for each batch. Single-suite filters, `-j 1`, coverage,
debugging, repeat and generation modes use one process.
- **Behavior change:** Packed-file average metrics follow bvar's scheduled
sampling under concurrent writes.
### Testing
- All 50 runner checks passed on macOS and Linux ARM64. They cover
selection, worker isolation, memory admission, crash and timeout recovery, XML,
and interruption.
- On macOS ASAN, 17,886 cases ran in independent processes. All 39 cases
addressed by fixture fixes passed their exact-filter reruns. The full shuffled
run before Python socket isolation passed 17,806 cases, skipped 78, and
reproduced two known geography failures. The two Python suites then passed 51
shuffled cases with the isolation change.
- The final macOS ordered run passed 17,805, skipped 78, and failed the two
geography cases and one ECS provider test. The ECS test passed 24 independent
reruns, 12 paired reruns, and a serial replay of its original batch. A Python
shutdown case that aborted after its assertions in one independent process
passed 24 independent reruns.
- On Linux ARM64 ASAN, the same 244 affected cases passed individually and
in serial, parallel, and shuffled groups. Later targeted checks cover the
directory and Python socket fixes. The full run reproduced four independent
storage byte-golden differences. The large intersection suite passed after
measuring its memory use for the runner.
### Release note
Packed-file average metrics follow the rolling time window during concurrent
uploads.
### Check List (For Author)
- Behavior changed: Yes (see Details)
- Does this need documentation: No
- Pre-submission status: Partially verified: Linux ARM64 storage goldens
differ and two intermittent macOS outcomes did not reproduce on rerun
### AI Disclosure
- Tool: Claude Code (Claude Opus 5.5), OpenAI Codex
- Generated: Claude Code wrote the original runner and fixture changes.
Codex ported the commits, wrote subsequent fixture and packed-file metric
fixes, and prepared the verification and description.
- Human review: not stated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]