Title: [267354] trunk/LayoutTests/imported/w3c
Revision
267354
Author
commit-qu...@webkit.org
Date
2020-09-21 12:31:35 -0700 (Mon, 21 Sep 2020)

Log Message

Increase the maximum number of open files for wpt's servers
https://bugs.webkit.org/show_bug.cgi?id=215829

Patch by Sam Sneddon <gsnedd...@apple.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):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (267353 => 267354)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-09-21 19:18:58 UTC (rev 267353)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-09-21 19:31:35 UTC (rev 267354)
@@ -1,3 +1,15 @@
+2020-09-21  Sam Sneddon  <gsnedd...@apple.com>
+
+        Increase the maximum number of open files for wpt's servers
+        https://bugs.webkit.org/show_bug.cgi?id=215829
+
+        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):
+
 2020-09-20  Sam Weinig  <wei...@apple.com>
 
         Performance.navigation and Performance.timing are incorrectly exposed to workers

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/tools/serve/serve.py (267353 => 267354)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/tools/serve/serve.py	2020-09-21 19:18:58 UTC (rev 267353)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/tools/serve/serve.py	2020-09-21 19:31:35 UTC (rev 267354)
@@ -8,8 +8,10 @@
 import logging
 import os
 import platform
+import resource
 import signal
 import socket
+import subprocess
 import sys
 import threading
 import time
@@ -416,6 +418,18 @@
 
     def create_daemon(self, init_func, host, port, paths, routes, bind_address,
                       config, **kwargs):
+        if sys.platform == "darwin":
+            # on Darwin, NOFILE starts with a very low limit (256), so bump it up a little
+            # by way of comparison, Debian starts with a limit of 1024, Windows 512
+            maxfilesperproc = int(subprocess.check_output(
+                ["sysctl", "-n", "kern.maxfilesperproc"]
+            ).strip())
+            soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
+            # 2048 is somewhat arbitrary, but gives us some headroom for wptrunner --parallel
+            # note that it's expected that 2048 will be the min here
+            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:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to