summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest/cmdline.py
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2023-11-10 17:17:45 (GMT)
committerGitHub <noreply@github.com>2023-11-10 17:17:45 (GMT)
commit3932b0f7b1566374427daa8bc47203032015e350 (patch)
treed7a4c61cda7d382f3e480f56f2ad9edb8ff29d6c /Lib/test/libregrtest/cmdline.py
parent0b06d2482d77e02c5d40e221f6046c9c355458b2 (diff)
downloadcpython-3932b0f7b1566374427daa8bc47203032015e350.zip
cpython-3932b0f7b1566374427daa8bc47203032015e350.tar.gz
cpython-3932b0f7b1566374427daa8bc47203032015e350.tar.bz2
gh-110722: Make `-m test -T -j` use sys.monitoring (GH-111710)
Now all results from worker processes are aggregated and displayed together as a summary at the end of a regrtest run. The traditional trace is left in place for use with sequential in-process test runs but now raises a warning that those numbers are not precise. `-T -j` requires `--with-pydebug` as it relies on `-Xpresite=`.
Diffstat (limited to 'Lib/test/libregrtest/cmdline.py')
-rw-r--r--Lib/test/libregrtest/cmdline.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py
index 1747511..a5f02d6 100644
--- a/Lib/test/libregrtest/cmdline.py
+++ b/Lib/test/libregrtest/cmdline.py
@@ -2,7 +2,7 @@ import argparse
import os.path
import shlex
import sys
-from test.support import os_helper
+from test.support import os_helper, Py_DEBUG
from .utils import ALL_RESOURCES, RESOURCE_NAMES
@@ -448,8 +448,16 @@ def _parse_args(args, **kwargs):
if ns.single and ns.fromfile:
parser.error("-s and -f don't go together!")
- if ns.use_mp is not None and ns.trace:
- parser.error("-T and -j don't go together!")
+ if ns.trace:
+ if ns.use_mp is not None:
+ if not Py_DEBUG:
+ parser.error("need --with-pydebug to use -T and -j together")
+ else:
+ print(
+ "Warning: collecting coverage without -j is imprecise. Configure"
+ " --with-pydebug and run -m test -T -j for best results.",
+ file=sys.stderr
+ )
if ns.python is not None:
if ns.use_mp is None:
parser.error("-p requires -j!")