carletes / mock-ssh-server

Python mock SSH server for testing purposes
MIT License
56 stars 32 forks source link

use selectors instead of select.select #16

Closed skshetry closed 4 years ago

skshetry commented 4 years ago

Hi! On DVC, we were having random test failures. On investigating, we found out that we were going over 1024 opened file descriptors which select fails to work with and had issue on our implementation, as well as the mock server.

So, this PR uses higher level selectors which uses *poll/kqueue on supported platforms and fallbacks to select. On Windows, sadly there's no alternative and we are stuck with the issue.

I have added selectors2 for <3.4 (selectors was introduced in 3.4). It'd be great if we could merge this. Thanks.

carletes commented 4 years ago

Thanks, @skshetry! I'm merging this in --- will upload to PyPI shortly.

carletes commented 4 years ago

@skshetry: I've added you to this project's list of collaborators. For future PRs, if you do not hear from me or from the other collaborators within one week, and if all tests pass, feel free to merge them into master.

skshetry commented 4 years ago

@carletes, Thanks a lot for the merge.

carletes commented 4 years ago

In PyPI now: https://pypi.org/project/mock-ssh-server/