Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
27667b64
Commit
27667b64
authored
Nov 18, 2019
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More PyPy tweaks.
parent
07891830
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
19 deletions
+28
-19
src/gevent/testing/openfiles.py
src/gevent/testing/openfiles.py
+17
-13
src/gevent/tests/test__makefile_ref.py
src/gevent/tests/test__makefile_ref.py
+11
-6
No files found.
src/gevent/testing/openfiles.py
View file @
27667b64
...
...
@@ -108,20 +108,24 @@ else:
(socket.listen(1)). Unlike the lsof implementation, this will only
return sockets in a state like that.
"""
if
sysinfo
.
PYPY
:
# We've seen OSError: No such file or directory /proc/PID/fd/NUM.
# This occurs in the loop that checks open files. It first does listdir()
# and then tries readlink() on each file. But the file went away.
# This must be because of async GC in PyPy running destructors at arbitrary
# times. This became an issue in PyPy 7.2. Try to clean that up before w
e
# begin.
import
gc
gc
.
collect
()
gc
.
collect
()
# We've seen OSError: No such file or directory
# /proc/PID/fd/NUM. This occurs in the loop that checks open
# files. It first does listdir() and then tries readlink() on
# each file. But the file went away. This must be because of
# async GC in PyPy running destructors at arbitrary times.
# This became an issue in PyPy 7.2 but could theoretically b
e
# an issue with any objects caught in a cycle. Try to clean
# that up before we begin.
import
gc
gc
.
collect
()
gc
.
collect
()
results
=
dict
()
process
=
psutil
.
Process
()
results
[
'data'
]
=
process
.
open_files
()
+
process
.
connections
(
'all'
)
gc
.
disable
()
try
:
process
=
psutil
.
Process
()
results
[
'data'
]
=
process
.
open_files
()
+
process
.
connections
(
'all'
)
finally
:
gc
.
enable
()
for
x
in
results
[
'data'
]:
results
[
x
.
fd
]
=
x
results
[
'data'
]
+=
[
'From psutil'
,
process
]
...
...
src/gevent/tests/test__makefile_ref.py
View file @
27667b64
...
...
@@ -110,12 +110,17 @@ class Test(greentest.TestCase):
def
make_open_socket
(
self
):
s
=
socket
.
socket
()
s
.
bind
(
DEFAULT_BIND_ADDR_TUPLE
)
if
WIN
or
greentest
.
LINUX
:
# Windows and linux (with psutil) doesn't show as open until
# we call listen (linux with lsof accepts either)
s
.
listen
(
1
)
self
.
assert_open
(
s
,
s
.
fileno
())
try
:
s
.
bind
(
DEFAULT_BIND_ADDR_TUPLE
)
if
WIN
or
greentest
.
LINUX
:
# Windows and linux (with psutil) doesn't show as open until
# we call listen (linux with lsof accepts either)
s
.
listen
(
1
)
self
.
assert_open
(
s
,
s
.
fileno
())
except
:
s
.
close
()
s
=
None
raise
return
s
# Sometimes its this one, sometimes it's test_ssl. No clue why or how.
...
...
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