From 889d6463b39ab2d6068b7eed7212eebd16e39574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Fran=C3=A7ois=20Natali?= Date: Tue, 22 Jul 2014 21:25:03 +0100 Subject: [PATCH] Issue #21901: Cap the maximum number of file descriptors to use for the test. --- Lib/test/test_selectors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py index 34edd7630dd..46026be0aa6 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