Skip to content

Commit

Permalink
Bug 1667104 [wpt PR 25773] - Increase maximum open files for each ser…
Browse files Browse the repository at this point in the history
…ver process on Darwin (WebKit export), a=testonly

Automatic update from web-platform-tests
Increase the maximum number of open files for wpt's servers https://bugs.webkit.org/show_bug.cgi?id=215829

Patch by Sam Sneddon <gsneddersapple.com> on 2020-09-21
Reviewed by Youenn Fablet.

macOS has a much lower limits than other OSes by default, and the iOS bots often run into it with their level of parallel test execution. This bumps the limit for each wptserve process up to 2048, which is double the limit on Debian, and should probably be safe.

* web-platform-tests/tools/serve/serve.py:
(ServerProc.create_daemon):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk267354 268f45cc-cd09-0410-ab3c-d52691b4dbfc

--
REGRESSION(r267354): Only import resource module on Darwin https://bugs.webkit.org/show_bug.cgi?id=216823

Patch by Sam Sneddon <gsneddersapple.com> on 2020-09-22
Reviewed by Darin Adler.

* web-platform-tests/tools/serve/serve.py:
Move the resource import to the local point behind the Darwin platform
test. This code is only run once per process initiation, hence it makes
no difference to have the import locally.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk267417 268f45cc-cd09-0410-ab3c-d52691b4dbfc

--

wpt-commits: 64cdc2d8769e69f9b08bdff153e973a88aa015aa, b3b32e61d700d3bd9877c755e3aa943b0c468e0c
wpt-pr: 25773

UltraBlame original commit: 28a042a6bb19b9730a9fa3089101e6e795d8942f
  • Loading branch information
marco-c committed Sep 28, 2020
1 parent 34425ef commit 897efd7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions testing/web-platform/tests/tools/serve/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,19 @@ def start(self, init_func, host, port, paths, routes, bind_address, config, **kw

def create_daemon(self, init_func, host, port, paths, routes, bind_address,
config, **kwargs):
if sys.platform == "darwin":


import resource
maxfilesperproc = int(subprocess.check_output(
["sysctl", "-n", "kern.maxfilesperproc"]
).strip())
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)


new_soft = min(2048, maxfilesperproc, hard)
if soft < new_soft:
resource.setrlimit(resource.RLIMIT_NOFILE, (new_soft, hard))
try:
self.daemon = init_func(host, port, paths, routes, bind_address, config, **kwargs)
except socket.error:
Expand Down

0 comments on commit 897efd7

Please sign in to comment.