summaryrefslogtreecommitdiff
path: root/kazoo/tests/test_threading_handler.py
diff options
context:
space:
mode:
authorWang <taptube@gmail.com>2022-02-03 07:59:08 +0800
committerGitHub <noreply@github.com>2022-02-02 18:59:08 -0500
commit4042a8505cdac94dba5718b6a89f82d478fef0d6 (patch)
tree18cd3b7f656979907d2513dc1e6fc80e994603cd /kazoo/tests/test_threading_handler.py
parentf585d605eea0a37a08aae95a8cc259b80da2ecf0 (diff)
downloadkazoo-4042a8505cdac94dba5718b6a89f82d478fef0d6.tar.gz
fix(core): use selectors to poll connections instead of raw select in threading,gevent,eventlet (#656)
Co-authored-by: lawrentwang <lawrentwang@tencent.com> Solve the select limitation on a maximum file handler value and dynamic choose the best poller in the system.
Diffstat (limited to 'kazoo/tests/test_threading_handler.py')
-rw-r--r--kazoo/tests/test_threading_handler.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/kazoo/tests/test_threading_handler.py b/kazoo/tests/test_threading_handler.py
index 4376957..dbdccd7 100644
--- a/kazoo/tests/test_threading_handler.py
+++ b/kazoo/tests/test_threading_handler.py
@@ -45,10 +45,6 @@ class TestThreadingHandler(unittest.TestCase):
assert h._running is False
def test_huge_file_descriptor(self):
- from kazoo.handlers.threading import _HAS_EPOLL
-
- if not _HAS_EPOLL:
- self.skipTest('only run on systems with epoll()')
import resource
import socket
from kazoo.handlers.utils import create_tcp_socket
@@ -65,11 +61,10 @@ class TestThreadingHandler(unittest.TestCase):
socks.append(sock)
h = self._makeOne()
h.start()
- h.select(socks, [], [])
- with pytest.raises(ValueError):
- h._select(socks, [], [])
- h._epoll_select(socks, [], [])
+ h.select(socks, [], [], 0)
h.stop()
+ for sock in socks:
+ sock.close()
class TestThreadingAsync(unittest.TestCase):