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=`.
This commit is contained in:
Łukasz Langa 2023-11-10 18:17:45 +01:00 committed by GitHub
parent 0b06d2482d
commit 3932b0f7b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 166 additions and 34 deletions

View file

@ -306,13 +306,23 @@ class ParseArgsTestCase(unittest.TestCase):
self.assertEqual(ns.use_mp, 2)
self.checkError([opt], 'expected one argument')
self.checkError([opt, 'foo'], 'invalid int value')
self.checkError([opt, '2', '-T'], "don't go together")
self.checkError([opt, '0', '-T'], "don't go together")
def test_coverage(self):
def test_coverage_sequential(self):
for opt in '-T', '--coverage':
with self.subTest(opt=opt):
ns = self.parse_args([opt])
with support.captured_stderr() as stderr:
ns = self.parse_args([opt])
self.assertTrue(ns.trace)
self.assertIn(
"collecting coverage without -j is imprecise",
stderr.getvalue(),
)
@unittest.skipUnless(support.Py_DEBUG, 'need a debug build')
def test_coverage_mp(self):
for opt in '-T', '--coverage':
with self.subTest(opt=opt):
ns = self.parse_args([opt, '-j1'])
self.assertTrue(ns.trace)
def test_coverdir(self):