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: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=889d6463b39ab2d6068b7eed7212eebd16e39574;p=python 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 34edd7630d..46026be0aa 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