Skip to content

Commit 5e605c8

Browse files
committed
[wpe-2.38] Partial import of 261707@main
Patch add option '--enable-core-dumps-nolimit' to enable coredumps in buildbot. Only the changes in 'Tools/Scripts' are needed.
1 parent 042c5d1 commit 5e605c8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import logging
3333
import optparse
3434
import os
35+
import resource
3536
import traceback
3637

3738
from webkitpy.common.host import Host
@@ -309,6 +310,7 @@ def parse_args(args):
309310
optparse.make_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland'], default='xvfb',
310311
help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
311312
'"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.'),
313+
optparse.make_option('--enable-core-dumps-nolimit', action='store_true', default=False, help='Enable core dumps for the test run (runs the equivalent of "ulimit -c unlimited" before starting the tests).'),
312314
optparse.make_option("--world-leaks", action="store_true", default=False, help="Check for world leaks (currently, only documents). Differs from --leaks in that this uses internal instrumentation, rather than external tools."),
313315
optparse.make_option("--accessibility-isolated-tree", action="store_true", default=False, help="Runs tests in accessibility isolated tree mode."),
314316
optparse.make_option("--allowed-host", type="string", action="append", default=[], help="If specified, tests are allowed to make requests to the specified hostname."),
@@ -488,6 +490,13 @@ def run(port, options, args, logging_stream):
488490
try:
489491
printer = printing.Printer(port, options, logging_stream, logger=logger)
490492

493+
if options.enable_core_dumps_nolimit:
494+
try:
495+
resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))
496+
_log.debug('Enabled coredumps for test run')
497+
except (ValueError, OSError) as e:
498+
_log.error('Failed to enable coredumps: %s' % str(e))
499+
491500
_set_up_derived_options(port, options)
492501
manager = Manager(port, options, printer)
493502
printer.print_config(port.results_directory())

0 commit comments

Comments
 (0)