Files
deb-python-eventlet/tests/isolated/tpool_isolate_socket_default_timeout.py
Sergey Shepelev cb8ac9b567 tpool: isolate internal socket from default timeout; Thanks to Alex Villacís Lasso
Since commit f37a87b the internal implementation of tpool uses sockets
instead of pipes for communication. If, for whatever reason, the user code
calls socket.setdefaulttimeout() with some nonzero value, tpool's internal
socket now inherits this timeout. This causes the tpool to receive
a `socket.timeout` exception where none was expected.
https://github.com/eventlet/eventlet/pull/330
2016-08-10 11:23:54 +05:00

16 lines
284 B
Python

__test__ = False
if __name__ == '__main__':
import eventlet
import eventlet.tpool
import socket
def do():
eventlet.sleep(0.2)
return True
socket.setdefaulttimeout(0.05)
result = eventlet.tpool.execute(do)
assert result
print('pass')