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

Side by Side Diff: gcl.py

Issue 342543003: Increased timeout for rietveld lint calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/gcl_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """\ 6 """\
7 Wrapper script around Rietveld's upload.py that simplifies working with groups 7 Wrapper script around Rietveld's upload.py that simplifies working with groups
8 of files. 8 of files.
9 """ 9 """
10 10
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 """Adds a comment for an issue on Rietveld. 396 """Adds a comment for an issue on Rietveld.
397 As a side effect, this will email everyone associated with the issue.""" 397 As a side effect, this will email everyone associated with the issue."""
398 return self.RpcServer().add_comment(self.issue, comment) 398 return self.RpcServer().add_comment(self.issue, comment)
399 399
400 def PrimeLint(self): 400 def PrimeLint(self):
401 """Do background work on Rietveld to lint the file so that the results are 401 """Do background work on Rietveld to lint the file so that the results are
402 ready when the issue is viewed.""" 402 ready when the issue is viewed."""
403 if self.issue and self.patchset: 403 if self.issue and self.patchset:
404 try: 404 try:
405 self.SendToRietveld('/lint/issue%s_%s' % (self.issue, self.patchset), 405 self.SendToRietveld('/lint/issue%s_%s' % (self.issue, self.patchset),
406 timeout=10) 406 timeout=60)
407 except ssl.SSLError as e: 407 except ssl.SSLError as e:
408 # It takes more than 10 seconds to lint some CLs. Silently ignore 408 # It takes more than 60 seconds to lint some CLs. Silently ignore
409 # the expected timeout. 409 # the expected timeout.
410 if e.message != 'The read operation timed out': 410 if e.message != 'The read operation timed out':
411 raise 411 raise
412 412
413 def SendToRietveld(self, request_path, timeout=None, **kwargs): 413 def SendToRietveld(self, request_path, timeout=None, **kwargs):
414 """Send a POST/GET to Rietveld. Returns the response body.""" 414 """Send a POST/GET to Rietveld. Returns the response body."""
415 try: 415 try:
416 return self.RpcServer().Send(request_path, timeout=timeout, **kwargs) 416 return self.RpcServer().Send(request_path, timeout=timeout, **kwargs)
417 except urllib2.URLError: 417 except urllib2.URLError:
418 if timeout is None: 418 if timeout is None:
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 raise 1496 raise
1497 print >> sys.stderr, ( 1497 print >> sys.stderr, (
1498 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 1498 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
1499 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) 1499 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))
1500 return 1 1500 return 1
1501 1501
1502 1502
1503 if __name__ == "__main__": 1503 if __name__ == "__main__":
1504 fix_encoding.fix_encoding() 1504 fix_encoding.fix_encoding()
1505 sys.exit(main(sys.argv[1:])) 1505 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698