Add --test_parallel to reduce CTest concurrency for ASan builds#28675
Merged
Conversation
4 tasks
sanaa-hamel-microsoft
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
windows_x64_asan / build_x64CI pipeline has been failing with OOM (out-of-memory) because ASan-instrumented test binaries consume significantly more memory than normal builds, and CTest was running them at full CPU-count parallelism.This PR adds a
--test_parallelargument tobuild.pythat allows CTest concurrency to be configured independently from the build parallelism (--parallel). It then uses--test_parallel 4in the Windows x64 ASan workflow to cap test execution to 4 parallel jobs, preventing OOM while keeping build parallelism at full speed.Motivation and Context
--parallelflag controls both MSBuild and CTest concurrency together; there was no way to keep fast parallel builds while limiting test concurrency.Changes
tools/ci_build/build_args.py--test_parallelargument (default:None, falls back to--parallel)tools/ci_build/build.pynumber_of_test_parallel_jobs()helper; use it for CTest--parallel; validate negative values.github/workflows/windows_build_x64_asan.yml--test_parallel 4to cap ASan test concurrencyTesting
python -m py_compile tools/ci_build/build.py tools/ci_build/build_args.py— passespython tools/ci_build/build.py --helpshows the new--test_paralleloptiongit diff --check— no whitespace issues--test_parallelis omitted, behavior is unchanged (falls back to--parallelvalue)