Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.12] gh-108834: Sync libregrtest with the main branch #108966

Merged
merged 4 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ def test_close(self):

close_queue(q)

@support.requires_resource('walltime')
def test_many_processes(self):
if self.TYPE == 'threads':
self.skipTest('test not appropriate for {}'.format(self.TYPE))
Expand Down Expand Up @@ -4953,6 +4954,7 @@ def test_wait_slow(self):
def test_wait_socket_slow(self):
self.test_wait_socket(True)

@support.requires_resource('walltime')
def test_wait_timeout(self):
from multiprocessing.connection import wait

Expand Down Expand Up @@ -4981,6 +4983,7 @@ def signal_and_sleep(cls, sem, period):
sem.release()
time.sleep(period)

@support.requires_resource('walltime')
def test_wait_integer(self):
from multiprocessing.connection import wait

Expand Down
7 changes: 4 additions & 3 deletions Lib/test/bisect_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ def parse_args():

def main():
args = parse_args()
if '-w' in args.test_args or '--verbose2' in args.test_args:
print("WARNING: -w/--verbose2 option should not be used to bisect!")
print()
for opt in ('-w', '--rerun', '--verbose2'):
if opt in args.test_args:
print(f"WARNING: {opt} option should not be used to bisect!")
print()

if args.input:
with open(args.input) as fp:
Expand Down
15 changes: 11 additions & 4 deletions Lib/test/libregrtest/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@

cpu - Used for certain CPU-heavy tests.

walltime - Long running but not CPU-bound tests.

subprocess Run all tests for the subprocess module.

urlfetch - It is okay to download files required on testing.
Expand All @@ -129,7 +131,7 @@


ALL_RESOURCES = ('audio', 'curses', 'largefile', 'network',
'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui')
'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui', 'walltime')

# Other resources excluded from --use=all:
#
Expand All @@ -156,7 +158,7 @@ def __init__(self, **kwargs) -> None:
self.coverdir = 'coverage'
self.runleaks = False
self.huntrleaks = False
self.verbose2 = False
self.rerun = False
self.verbose3 = False
self.print_slow = False
self.random_seed = None
Expand Down Expand Up @@ -213,8 +215,10 @@ def _create_parser():
group = parser.add_argument_group('Verbosity')
group.add_argument('-v', '--verbose', action='count',
help='run tests in verbose mode with output to stdout')
group.add_argument('-w', '--verbose2', action='store_true',
group.add_argument('-w', '--rerun', action='store_true',
help='re-run failed tests in verbose mode')
group.add_argument('--verbose2', action='store_true', dest='rerun',
help='deprecated alias to --rerun')
group.add_argument('-W', '--verbose3', action='store_true',
help='display test output on failure')
group.add_argument('-q', '--quiet', action='store_true',
Expand Down Expand Up @@ -309,6 +313,9 @@ def _create_parser():
group.add_argument('--fail-env-changed', action='store_true',
help='if a test file alters the environment, mark '
'the test as failed')
group.add_argument('--fail-rerun', action='store_true',
help='if a test failed and then passed when re-run, '
'mark the tests as failed')

group.add_argument('--junit-xml', dest='xmlpath', metavar='FILENAME',
help='writes JUnit-style XML results to the specified '
Expand Down Expand Up @@ -380,7 +387,7 @@ def _parse_args(args, **kwargs):
ns.python = shlex.split(ns.python)
if ns.failfast and not (ns.verbose or ns.verbose3):
parser.error("-G/--failfast needs either -v or -W")
if ns.pgo and (ns.verbose or ns.verbose2 or ns.verbose3):
if ns.pgo and (ns.verbose or ns.rerun or ns.verbose3):
parser.error("--pgo/-v don't go together!")
if ns.pgo_extended:
ns.pgo = True # pgo_extended implies pgo
Expand Down
Loading
Loading