Skip to content

Commit e8e77f5

Browse files
committed
PYTHON-1227 - Don't use select.POLLNVAL
It causes problems with Jython and seems unnecessary since we know the fd represents an open socket.
1 parent ca42250 commit e8e77f5

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

pymongo/network.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
_EVENT_MASK = 0
2525
try:
2626
from select import poll
27-
_EVENT_MASK = (select.POLLIN | select.POLLPRI | select.POLLERR |
28-
select.POLLHUP | select.POLLNVAL)
27+
_EVENT_MASK = (
28+
select.POLLIN | select.POLLPRI | select.POLLERR | select.POLLHUP)
2929
except ImportError:
3030
_HAS_POLL = False
3131

test/test_client.py

-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ def test_min_pool_size(self):
314314
"a closed socket gets replaced from the pool")
315315
self.assertFalse(sock_info in server._pool.sockets)
316316

317-
@unittest.skipIf(sys.platform.startswith('java'), 'PYTHON-1227')
318317
def test_max_idle_time_checkout(self):
319318
# Use high frequency to test _get_socket_no_auth.
320319
with client_knobs(kill_cursor_frequency=99999999):

test/test_pooling.py

-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ def test_no_disconnect(self):
191191
def test_disconnect(self):
192192
run_cases(self.c, [InsertOneAndFind, Disconnect, Unique])
193193

194-
@unittest.skipIf(sys.platform.startswith('java'), 'PYTHON-1227')
195194
def test_pool_reuses_open_socket(self):
196195
# Test Pool's _check_closed() method doesn't close a healthy socket.
197196
cx_pool = self.create_pool(max_pool_size=10)
@@ -250,7 +249,6 @@ def test_pool_removes_dead_socket(self):
250249
with cx_pool.get_socket({}):
251250
pass
252251

253-
@unittest.skipIf(sys.platform.startswith('java'), 'PYTHON-1227')
254252
def test_socket_closed(self):
255253
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
256254
s.connect((client_context.host, client_context.port))
@@ -330,7 +328,6 @@ def test_wait_queue_timeout(self):
330328

331329
sock_info.close()
332330

333-
@unittest.skipIf(sys.platform.startswith('java'), 'PYTHON-1227')
334331
def test_no_wait_queue_timeout(self):
335332
# Verify get_socket() with no wait_queue_timeout blocks forever.
336333
pool = self.create_pool(max_pool_size=1)

0 commit comments

Comments
 (0)