Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
da57599a
Commit
da57599a
authored
Sep 18, 2019
by
Victor Stinner
Committed by
GitHub
Sep 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-38203: regrtest: put a 2 min timeout on Python exit (GH-16250)
parent
272d0d01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
Lib/test/libregrtest/main.py
Lib/test/libregrtest/main.py
+24
-10
No files found.
Lib/test/libregrtest/main.py
View file @
da57599a
...
...
@@ -22,6 +22,12 @@ from test.libregrtest.utils import removepy, count, format_duration, printlist
from
test
import
support
# bpo-38203: Maximum delay in seconds to exit Python (call Py_Finalize()).
# Used to protect against threading._shutdown() hang.
# Must be smaller than buildbot "1200 seconds without output" limit.
EXIT_TIMEOUT
=
120.0
class
Regrtest
:
"""Execute a test suite.
...
...
@@ -616,16 +622,24 @@ class Regrtest:
test_cwd
=
self
.
create_temp_dir
()
# Run the tests in a context manager that temporarily changes the CWD
# to a temporary and writable directory. If it's not possible to
# create or change the CWD, the original CWD will be used.
# The original CWD is available from support.SAVEDCWD.
with
support
.
temp_cwd
(
test_cwd
,
quiet
=
True
):
# When using multiprocessing, worker processes will use test_cwd
# as their parent temporary directory. So when the main process
# exit, it removes also subdirectories of worker processes.
self
.
ns
.
tempdir
=
test_cwd
self
.
_main
(
tests
,
kwargs
)
try
:
# Run the tests in a context manager that temporarily changes the CWD
# to a temporary and writable directory. If it's not possible to
# create or change the CWD, the original CWD will be used.
# The original CWD is available from support.SAVEDCWD.
with
support
.
temp_cwd
(
test_cwd
,
quiet
=
True
):
# When using multiprocessing, worker processes will use test_cwd
# as their parent temporary directory. So when the main process
# exit, it removes also subdirectories of worker processes.
self
.
ns
.
tempdir
=
test_cwd
self
.
_main
(
tests
,
kwargs
)
except
SystemExit
as
exc
:
# bpo-38203: Python can hang at exit in Py_Finalize(), especially
# on threading._shutdown() call: put a timeout
faulthandler
.
dump_traceback_later
(
EXIT_TIMEOUT
,
exit
=
True
)
sys
.
exit
(
exc
.
code
)
def
getloadavg
(
self
):
if
self
.
win_load_tracker
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment