mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-109162: Refactor libregrtest.runtest_mp (#109205)
* Add attributes to Regrtest and RunTests: * fail_env_changed * num_workers * Rename MultiprocessTestRunner to RunWorkers. Add num_workers parameters to RunWorkers constructor. Remove RunWorkers.ns attribute. * Rename TestWorkerProcess to WorkerThread. * get_running() now returns a string like: "running (...): ...". * Regrtest.action_run_tests() now selects the number of worker processes, instead of the command line parser.
This commit is contained in:
parent
0c0f254230
commit
0553fdfe30
4 changed files with 57 additions and 56 deletions
|
@ -1,5 +1,5 @@
|
|||
import argparse
|
||||
import os
|
||||
import os.path
|
||||
import shlex
|
||||
import sys
|
||||
from test.support import os_helper
|
||||
|
@ -410,10 +410,6 @@ def _parse_args(args, **kwargs):
|
|||
if ns.timeout is not None:
|
||||
if ns.timeout <= 0:
|
||||
ns.timeout = None
|
||||
if ns.use_mp is not None:
|
||||
if ns.use_mp <= 0:
|
||||
# Use all cores + extras for tests that like to sleep
|
||||
ns.use_mp = 2 + (os.cpu_count() or 1)
|
||||
if ns.use:
|
||||
for a in ns.use:
|
||||
for r in a:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue