diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 20:54:16 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 20:54:16 +0000 |
commit | 7fa42f1c5b40a76a964bd8a0c7a686f087d17c5b (patch) | |
tree | 8b3a36f59710e0071be8ae5a2c7347bce072a468 /PRESUBMIT.py | |
parent | 72403e2237875cc891f788e722c2996705f53451 (diff) | |
download | chromium_src-7fa42f1c5b40a76a964bd8a0c7a686f087d17c5b.zip chromium_src-7fa42f1c5b40a76a964bd8a0c7a686f087d17c5b.tar.gz chromium_src-7fa42f1c5b40a76a964bd8a0c7a686f087d17c5b.tar.bz2 |
Warn when number of inflight build is too high.
TEST=none
BUG=27143
Review URL: http://codereview.chromium.org/381005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 734bb31..a8d46d7 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -71,6 +71,33 @@ def CheckChangeOnCommit(input_api, output_api): '0', 'http://chromium-status.appspot.com/current?format=raw')) results.extend(CheckTryJobExecution(input_api, output_api)) + # These builders are just too slow. + IGNORED_BUILDERS = [ + 'Chromium XP', + 'XP Unit (purify)', + 'Modules XP (purify)', + 'Webkit (purify)', + 'Chromium Mac', + 'Chromium Mac (valgrind)', + 'Chromium Mac UI (valgrind)(1)', + 'Chromium Mac UI (valgrind)(2)', + 'Chromium Mac UI (valgrind)(3)', + 'Chromium Mac (tsan)', + 'Webkit Mac (valgrind)', + 'Chromium Linux', + 'Chromium Linux x64', + 'Linux Tests (valgrind)(1)', + 'Linux Tests (valgrind)(2)', + 'Linux Tests (valgrind)(3)', + 'Linux Tests (valgrind)(4)', + 'Webkit Linux (valgrind layout)', + ] + results.extend(CheckPendingBuilds( + input_api, + output_api, + 'http://build.chromium.org/buildbot/waterfall/json/builders', + 6, + IGNORED_BUILDERS)) return results @@ -145,5 +172,35 @@ def CheckTreeIsOpen(input_api, output_api, url, closed, url_text): return [] +def CheckPendingBuilds(input_api, output_api, url, max_pendings, ignored): + try: + connection = input_api.urllib2.urlopen(url) + raw_data = connection.read() + connection.close() + try: + import simplejson + data = simplejson.parse(raw_data) + except ImportError: + # simplejson is much safer. But we should be just fine enough with that: + data = eval(raw_data.replace('null', 'None')) + out = [] + for (builder_name, builder) in data.iteritems(): + if builder_name in ignored: + continue + pending_builds_len = len(builder.get('pending_builds', [])) + if pending_builds_len > max_pendings: + out.append('%s has %d build(s) pending' % + (builder_name, pending_builds_len)) + if out: + return [output_api.PresubmitPromptWarning( + 'Build(s) pending. It is suggested to wait that no more than %d ' + 'builds are pending.' % max_pendings, + long_text='\n'.join(out))] + except IOError: + # Silently pass. + pass + return [] + + def GetPreferredTrySlaves(): return ['win', 'linux', 'mac'] |