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
8acc3c57
Commit
8acc3c57
authored
Oct 18, 2013
by
Richard Oudkerk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove test_sigterm().
parent
1805a62f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
41 deletions
+0
-41
Lib/test/_test_multiprocessing.py
Lib/test/_test_multiprocessing.py
+0
-41
No files found.
Lib/test/_test_multiprocessing.py
View file @
8acc3c57
...
...
@@ -273,11 +273,7 @@ class _TestProcess(BaseTestCase):
@
classmethod
def
_test_terminate
(
cls
):
print
(
'signal.getsignal(SIGTERM) ='
,
signal
.
getsignal
(
signal
.
SIGTERM
),
file
=
sys
.
stderr
)
print
(
'starting sleep'
,
file
=
sys
.
stderr
)
time
.
sleep
(
100
)
print
(
'finished sleep'
,
file
=
sys
.
stderr
)
def
test_terminate
(
self
):
if
self
.
TYPE
==
'threads'
:
...
...
@@ -315,10 +311,6 @@ class _TestProcess(BaseTestCase):
try
:
signal
.
alarm
(
10
)
self
.
assertEqual
(
join
(),
None
)
except
RuntimeError
:
print
(
'os.waitpid() ='
,
os
.
waitpid
(
p
.
pid
,
os
.
WNOHANG
),
file
=
sys
.
stderr
)
raise
finally
:
signal
.
alarm
(
0
)
signal
.
signal
(
signal
.
SIGALRM
,
old_handler
)
...
...
@@ -335,39 +327,6 @@ class _TestProcess(BaseTestCase):
# XXX sometimes get p.exitcode == 0 on Windows ...
#self.assertEqual(p.exitcode, -signal.SIGTERM)
@
unittest
.
skipIf
(
WIN32
,
'Unix only'
)
def
test_sigterm
(
self
):
# A test for the Gentoo build bot which does not directly use
# multiprocessing. Start and terminate child processes.
if
self
.
TYPE
!=
'processes'
:
return
for
i
in
range
(
10
):
pid
=
os
.
fork
()
if
pid
==
0
:
try
:
print
(
'sleeping'
,
file
=
sys
.
stderr
)
time
.
sleep
(
100
)
print
(
'waking'
,
file
=
sys
.
stderr
)
finally
:
sys
.
stderr
.
flush
()
os
.
_exit
(
0
)
else
:
os
.
kill
(
pid
,
signal
.
SIGTERM
)
def
handler
(
*
args
):
raise
RuntimeError
(
'waitpid() took too long'
)
old_handler
=
signal
.
signal
(
signal
.
SIGALRM
,
handler
)
try
:
signal
.
alarm
(
10
)
pid_status
=
os
.
waitpid
(
pid
,
0
)
self
.
assertEqual
(
pid_status
[
0
],
pid
)
except
RuntimeError
:
print
(
'os.waitpid() ='
,
os
.
waitpid
(
pid
,
os
.
WNOHANG
),
file
=
sys
.
stderr
)
raise
finally
:
signal
.
alarm
(
0
)
signal
.
signal
(
signal
.
SIGALRM
,
old_handler
)
def
test_cpu_count
(
self
):
try
:
cpus
=
multiprocessing
.
cpu_count
()
...
...
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