Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: tools/bots/bot_utils.py

Issue 1685743004: Enable coredumps for dart2js unit tests on buildbot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/bots/compiler.py » ('j') | tools/bots/compiler.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bots/bot_utils.py
diff --git a/tools/bots/bot_utils.py b/tools/bots/bot_utils.py
index 1feaf2c136af693a83f85ff4ddff2457d3e39ed9..d92f4271f88d13a7fbc0f5b3269fe579ae0b5c6f 100644
--- a/tools/bots/bot_utils.py
+++ b/tools/bots/bot_utils.py
@@ -12,6 +12,13 @@ import string
import subprocess
import sys
+# The resource package does not exist on Windows but its functionality is not
+# used there, either.
+try:
+ import resource
+except ImportError:
+ resource = None;
+
DART_DIR = os.path.abspath(
os.path.normpath(os.path.join(__file__, '..', '..', '..')))
@@ -365,3 +372,14 @@ def GetChannelFromName(name):
if channel_name in Channel.ALL_CHANNELS:
return channel_name
return Channel.BLEEDING_EDGE
+
+class CoredumpEnabler(object):
+ def __init__(self):
+ self._old_limits = None
+
+ def __enter__(self):
+ self._old_limits = resource.getrlimit(resource.RLIMIT_CORE)
+ resource.setrlimit(resource.RLIMIT_CORE, (-1, -1))
+
+ def __exit__(self, *_):
+ resource.setrlimit(resource.RLIMIT_CORE, self._old_limits)
« no previous file with comments | « no previous file | tools/bots/compiler.py » ('j') | tools/bots/compiler.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698