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

Unified Diff: tools/run-bisect-perf-regression.py

Issue 1522233002: Clamp legacy bisect param max_time_minutes to be in the range [1, 60]. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/run-bisect-perf-regression.py
diff --git a/tools/run-bisect-perf-regression.py b/tools/run-bisect-perf-regression.py
index 7641617c5426bde916ba3730643b729733279f95..63afc10a0b58f52a034ed67b22f3a55de54493f9 100755
--- a/tools/run-bisect-perf-regression.py
+++ b/tools/run-bisect-perf-regression.py
@@ -199,7 +199,8 @@ def _CreateBisectOptionsFromConfig(config):
opts_dict['truncate_percent'] = int(config['truncate_percent'])
if config['max_time_minutes']:
- opts_dict['max_time_minutes'] = int(config['max_time_minutes'])
+ opts_dict['max_time_minutes'] = _Clamp(
+ int(config['max_time_minutes']), low=1, high=60)
if config.has_key('use_goma'):
opts_dict['use_goma'] = config['use_goma']
@@ -238,6 +239,11 @@ def _CreateBisectOptionsFromConfig(config):
return bisect_perf_regression.BisectOptions.FromDict(opts_dict)
+def _Clamp(n, low, high):
+ """Clamps a value to a range."""
+ return min(high, max(low, n))
+
+
def _ParseCloudLinksFromOutput(output):
html_results_pattern = re.compile(
r'\s(?P<VALUES>http://storage.googleapis.com/' +
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698