From: Mark Andrews Date: Tue, 5 Oct 2021 05:01:56 +0000 (+1100) Subject: Increase the number of file descriptors available X-Git-Tag: v9.16.22~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=050e6e757a624fdb74404133b2700eb5a4e2f333;p=thirdparty%2Fbind9.git Increase the number of file descriptors available The 'listenlist_test', 'notify_test', and 'query_test' tests failed when the descriptor limit was 256 on MacOS 11.6 with 8 cpus. On the test platform the limit needed to be increased to ~400. Increase the limit to at least 1024 to give some head room. (cherry picked from commit 877f52b7724d3f177486f6556493a07b6ce54661) --- diff --git a/lib/ns/tests/nstest.c b/lib/ns/tests/nstest.c index 4136d5397c6..238450d4789 100644 --- a/lib/ns/tests/nstest.c +++ b/lib/ns/tests/nstest.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -295,6 +296,22 @@ ns_test_begin(FILE *logfile, bool start_managers) { test_running = true; if (start_managers) { + isc_resourcevalue_t files; + + /* + * The 'listenlist_test', 'notify_test', and 'query_test' + * tests need more than 256 descriptors with 8 cpus. + * Bump up to at least 1024. + */ + result = isc_resource_getcurlimit(isc_resource_openfiles, + &files); + if (result == ISC_R_SUCCESS) { + if (files < 1024) { + files = 1024; + (void)isc_resource_setlimit( + isc_resource_openfiles, files); + } + } CHECK(isc_app_start()); } if (debug_mem_record) {