]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Increase the number of file descriptors for stress_http_quota.py
authorMark Andrews <marka@isc.org>
Fri, 8 Oct 2021 01:57:24 +0000 (12:57 +1100)
committerMark Andrews <marka@isc.org>
Wed, 20 Oct 2021 19:41:25 +0000 (19:41 +0000)
stress_http_quota.py uses more than 256 file descriptors and fails
on some platforms.  Increase the available descriptors to 1024.

bin/tests/system/doth/stress_http_quota.py

index e2ddae18198da7dabefd2b508f70077f0ba6b3d1..0ca0046e72c90ded2605c3d9fd29767234a6dce7 100755 (executable)
@@ -18,12 +18,20 @@ import random
 import time
 
 from functools import reduce
+from resource import getrlimit
+from resource import setrlimit
+from resource import RLIMIT_NOFILE
 
 MULTIDIG_INSTANCES = 10
 CONNECT_TRIES = 5
 
 random.seed()
 
+# Ensure we have enough file desriptors to work
+rlimit_nofile = getrlimit(RLIMIT_NOFILE)
+if rlimit_nofile[0] < 1024:
+    setrlimit(RLIMIT_NOFILE, (1024, rlimit_nofile[1]))
+
 
 # Introduce some random delay
 def jitter():