Commit 9bf133ca authored by Victor Stinner's avatar Victor Stinner

Fix #11825: disable regrtest timeout if Python doesn't support threads

parent 1f817f7e
...@@ -240,7 +240,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, ...@@ -240,7 +240,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
findleaks=False, use_resources=None, trace=False, coverdir='coverage', findleaks=False, use_resources=None, trace=False, coverdir='coverage',
runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, runleaks=False, huntrleaks=False, verbose2=False, print_slow=False,
random_seed=None, use_mp=None, verbose3=False, forever=False, random_seed=None, use_mp=None, verbose3=False, forever=False,
header=False, timeout=60*60): header=False):
"""Execute a test suite. """Execute a test suite.
This also parses command-line options and modifies its behavior This also parses command-line options and modifies its behavior
...@@ -263,6 +263,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, ...@@ -263,6 +263,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
directly to set the values that would normally be set by flags directly to set the values that would normally be set by flags
on the command line. on the command line.
""" """
if hasattr(faulthandler, 'dump_tracebacks_later'):
timeout = 60*60
else:
timeout = None
replace_stdout() replace_stdout()
...@@ -409,6 +413,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, ...@@ -409,6 +413,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
# join it with the saved CWD so it ends up where the user expects. # join it with the saved CWD so it ends up where the user expects.
testdir = os.path.join(support.SAVEDCWD, a) testdir = os.path.join(support.SAVEDCWD, a)
elif o == '--timeout': elif o == '--timeout':
if not hasattr(faulthandler, 'dump_tracebacks_later'):
print("--timeout option requires "
"faulthandler.dump_tracebacks_later", file=sys.stderr)
sys.exit(1)
timeout = float(a) timeout = float(a)
else: else:
print(("No handler for option {}. Please report this as a bug " print(("No handler for option {}. Please report this as a bug "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment