Commit d5782662 authored by Jason Madden's avatar Jason Madden

Tweaks for PyPy3 on Linux.

parent 88d36895
......@@ -843,6 +843,9 @@ if PYPY and PY3:
# (at least on OS X; it's less consistent about that on travis)
'test_ssl.NetworkedBIOTests.test_handshake',
# This passes various "invalid" strings and expects a ValueError. not sure why
# we don't see errors on CPython.
'test_subprocess.ProcessTestCase.test_invalid_env',
]
if OSX:
......@@ -854,9 +857,6 @@ if PYPY and PY3:
'test_subprocess.POSIXProcessTestCase.test_pass_fds_inheritable',
'test_subprocess.POSIXProcessTestCase.test_pipe_cloexec',
# This passes various "invalid" strings and expects a ValueError. not sure why
# we don't see errors on Linux.
'test_subprocess.ProcessTestCase.test_invalid_env',
# The below are new with 5.10.1
# These fail with 'OSError: received malformed or improperly truncated ancillary data'
......
......@@ -79,7 +79,13 @@ class Test(greentest.TestCase):
def assert_open(self, sock, *rest):
if isinstance(sock, fd_types):
if not WIN:
if WIN or (PYPY and PY3 and greentest.LINUX):
# We can't detect open file descriptors on Windows.
# On PyPy 3.6-7.3 on Travis CI (linux), for some reason the
# client file descriptors don't always show as open. Don't know why,
# was fine in 7.2.
pass
else:
self.assert_fd_open(sock)
else:
fileno = sock.fileno()
......
......@@ -128,16 +128,13 @@ class TestTCP(greentest.TestCase):
log("accepting", self.listener)
conn, _ = self.listener.accept()
try:
r = conn.makefile(mode='rb')
try:
with conn.makefile(mode='rb') as r:
log("accepted on server", conn)
accepted_event.set()
log("reading")
read_data.append(r.read())
log("done reading")
finally:
r.close()
del r
del r
finally:
conn.close()
del conn
......@@ -155,8 +152,9 @@ class TestTCP(greentest.TestCase):
# The implicit reference-based nastiness of Python 2
# sockets interferes, especially when using SSL sockets.
# The best way to get a decent FIN to the server is to shutdown
# the output. Doing that on Python 3, OTOH, is contraindicated.
should_shutdown = greentest.PY2
# the output. Doing that on Python 3, OTOH, is contraindicated
# except on PyPy.
should_shutdown = greentest.PY2 or greentest.PYPY
# It's important to wait for the server to fully accept before
# we shutdown and close the socket. In SSL mode, the number
......@@ -204,7 +202,7 @@ class TestTCP(greentest.TestCase):
log("closing")
client.close()
finally:
server.join(4)
server.join(10)
assert not server.is_alive()
if server.terminal_exc:
......
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