Test launcher relies on the fact that TaskScheduler won't have more concurrency than max_tasks to control |num_parallel_jobs| [1].
This causes problem in [2]; The TaskScheduler is allowed to run more tasks concurrently than |max_tasks| when some of these tasks are blocked. Considering Process:WaitForExitWithTimeout() as blocking (as it probably should) causes the test launcher to go over |num_parallel_jobs| and ultimately timeout in some tests.
A future jobs API for the TaskScheduler might offer a simple alternative.
Until then, I don't see any good alternative, so we'll keep current
behavior for Process:WaitForExitWithTimeout(), and use this bug as a reminder.
[1]: https://cs.chromium.org/chromium/src/base/test/launcher/test_launcher.cc?dr=CSs&g=0&l=435
[2]: https://chromium-review.googlesource.com/c/chromium/src/+/1324418
Comment 1 by bugdroid1@chromium.org
, Nov 16