PYTHON-1227 - Don't use select.POLLNVAL

It causes problems with Jython and seems unnecessary
since we know the fd represents an open socket.
This commit is contained in:
Bernie Hackett 2017-03-27 13:42:03 -07:00
parent ca42250102
commit e8e77f5a2c
3 changed files with 2 additions and 6 deletions

View File

@ -24,8 +24,8 @@ _HAS_POLL = True
_EVENT_MASK = 0
try:
from select import poll
_EVENT_MASK = (select.POLLIN | select.POLLPRI | select.POLLERR |
select.POLLHUP | select.POLLNVAL)
_EVENT_MASK = (
select.POLLIN | select.POLLPRI | select.POLLERR | select.POLLHUP)
except ImportError:
_HAS_POLL = False

View File

@ -314,7 +314,6 @@ class TestClient(IntegrationTest):
"a closed socket gets replaced from the pool")
self.assertFalse(sock_info in server._pool.sockets)
@unittest.skipIf(sys.platform.startswith('java'), 'PYTHON-1227')
def test_max_idle_time_checkout(self):
# Use high frequency to test _get_socket_no_auth.
with client_knobs(kill_cursor_frequency=99999999):

View File

@ -191,7 +191,6 @@ class TestPooling(_TestPoolingBase):
def test_disconnect(self):
run_cases(self.c, [InsertOneAndFind, Disconnect, Unique])
@unittest.skipIf(sys.platform.startswith('java'), 'PYTHON-1227')
def test_pool_reuses_open_socket(self):
# Test Pool's _check_closed() method doesn't close a healthy socket.
cx_pool = self.create_pool(max_pool_size=10)
@ -250,7 +249,6 @@ class TestPooling(_TestPoolingBase):
with cx_pool.get_socket({}):
pass
@unittest.skipIf(sys.platform.startswith('java'), 'PYTHON-1227')
def test_socket_closed(self):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((client_context.host, client_context.port))
@ -330,7 +328,6 @@ class TestPooling(_TestPoolingBase):
sock_info.close()
@unittest.skipIf(sys.platform.startswith('java'), 'PYTHON-1227')
def test_no_wait_queue_timeout(self):
# Verify get_socket() with no wait_queue_timeout blocks forever.
pool = self.create_pool(max_pool_size=1)