From: Charles-François Natali Date: Tue, 22 Jul 2014 20:25:03 +0000 (+0100) Subject: Issue #21901: Cap the maximum number of file descriptors to use for the test. X-Git-Tag: v3.4.2rc1~192 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=889d6463b39ab2d6068b7eed7212eebd16e39574;p=thirdparty%2FPython%2Fcpython.git Issue #21901: Cap the maximum number of file descriptors to use for the test. --- diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py index 34edd7630ddd..46026be0aa60 100644 --- a/Lib/test/test_selectors.py +++ b/Lib/test/test_selectors.py @@ -378,7 +378,7 @@ class ScalableSelectorMixIn: resource.setrlimit(resource.RLIMIT_NOFILE, (hard, hard)) self.addCleanup(resource.setrlimit, resource.RLIMIT_NOFILE, (soft, hard)) - NUM_FDS = hard + NUM_FDS = min(hard, 2**16) except (OSError, ValueError): NUM_FDS = soft