summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_linux.py8
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_mac.py5
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_win.py6
-rwxr-xr-xwebkit/tools/layout_tests/run_webkit_tests.py22
4 files changed, 27 insertions, 14 deletions
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
index 49ebacd..4c09676 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
@@ -23,6 +23,14 @@ def PlatformVersion():
minor versions, it returns ''."""
return ''
+def GetNumCores():
+ """Returns the number of cores on the machine. For hyperthreaded machines,
+ this will be double the number of actual processors."""
+ num_cores = os.sysconf("SC_NPROCESSORS_ONLN")
+ if isinstance(num_cores, int) and num_cores > 0:
+ return num_cores
+ return 1
+
def BaselineSearchPath(all_versions=False):
"""Returns the list of directories to search for baselines/results, in
order of preference. Paths are relative to the top of the source tree."""
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_mac.py b/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
index 27d6ed7..116375e 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
@@ -36,6 +36,11 @@ def PlatformVersion():
return ''
+def GetNumCores():
+ """Returns the number of cores on the machine. For hyperthreaded machines,
+ this will be double the number of actual processors."""
+ return int(os.popen2("sysctl -n hw.ncpu")[1].read())
+
# TODO: We should add leopard and snowleopard to the list of paths to check
# once we start running the tests from snowleopard.
def BaselineSearchPath(all_versions=False):
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_win.py b/webkit/tools/layout_tests/layout_package/platform_utils_win.py
index fb1e18f..7017ad6 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_win.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_win.py
@@ -5,6 +5,7 @@
"""This is the Linux implementation of the layout_package.platform_utils
package. This file should only be imported by that package."""
+import os
import path_utils
import subprocess
import sys
@@ -28,6 +29,11 @@ def PlatformVersion():
return '-xp'
return ''
+def GetNumCores():
+ """Returns the number of cores on the machine. For hyperthreaded machines,
+ this will be double the number of actual processors."""
+ return int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
+
def BaselineSearchPath(all_versions=False):
"""Returns the list of directories to search for baselines/results, in
order of preference. Paths are relative to the top of the source tree.
diff --git a/webkit/tools/layout_tests/run_webkit_tests.py b/webkit/tools/layout_tests/run_webkit_tests.py
index c86ac50..0a0c09a 100755
--- a/webkit/tools/layout_tests/run_webkit_tests.py
+++ b/webkit/tools/layout_tests/run_webkit_tests.py
@@ -40,6 +40,7 @@ from layout_package import test_expectations
from layout_package import http_server
from layout_package import json_results_generator
from layout_package import path_utils
+from layout_package import platform_utils
from layout_package import test_failures
from layout_package import test_shell_thread
from layout_package import test_files
@@ -139,6 +140,11 @@ class TestRunner:
self._shardable_directories = ['chrome', 'LayoutTests', 'pending', 'fast',
'svg']
+ # The http tests are very stable on the mac. Experiment with sharding
+ # the http directories to see if it considerably increases flakiness.
+ if sys.platform == 'darwin':
+ self._shardable_directories.extend(['http', 'tests'])
+
self._websocket_server = websocket_server.PyWebSocket(
options.results_directory)
# disable wss server. need to install pyOpenSSL on buildbots.
@@ -1236,20 +1242,8 @@ def main(options, args):
options.platform = path_utils.PlatformName(options.platform)
if not options.num_test_shells:
- cpus = 1
- if sys.platform in ('win32', 'cygwin'):
- cpus = int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
- elif (hasattr(os, "sysconf") and
- os.sysconf_names.has_key("SC_NPROCESSORS_ONLN")):
- # Linux & Unix:
- ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
- if isinstance(ncpus, int) and ncpus > 0:
- cpus = ncpus
- elif sys.platform in ('darwin'): # OSX:
- cpus = int(os.popen2("sysctl -n hw.ncpu")[1].read())
-
- # TODO(ojan): Use cpus+1 once we flesh out the flakiness.
- options.num_test_shells = cpus
+ # TODO(ojan): Investigate perf/flakiness impact of using numcores + 1.
+ options.num_test_shells = platform_utils.GetNumCores()
logging.info("Running %s test_shells in parallel" % options.num_test_shells)