| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import json | 5 import json |
| 6 import re | 6 import re |
| 7 import time | 7 import time |
| 8 import urllib | 8 import urllib |
| 9 | 9 |
| 10 from . import depot_config | 10 from . import depot_config |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 return False | 644 return False |
| 645 | 645 |
| 646 def wait_for_all(self, revision_list): | 646 def wait_for_all(self, revision_list): |
| 647 """Waits for all revisions in list to finish.""" | 647 """Waits for all revisions in list to finish.""" |
| 648 for r in revision_list: | 648 for r in revision_list: |
| 649 self.wait_for(r) | 649 self.wait_for(r) |
| 650 | 650 |
| 651 def wait_for(self, revision): | 651 def wait_for(self, revision): |
| 652 """Waits for any of the revisions in the list to finish its job(s).""" | 652 """Waits for any of the revisions in the list to finish its job(s).""" |
| 653 with self.api.m.step.nest('Waiting for ' + revision.revision_string()): | 653 with self.api.m.step.nest('Waiting for ' + revision.revision_string()): |
| 654 start_time = time.time() | |
| 655 while True: | 654 while True: |
| 656 revision.update_status() | 655 revision.update_status() |
| 657 if revision.in_progress: | 656 if revision.in_progress: |
| 658 self.api.m.python.inline( | 657 self.api.m.python.inline( |
| 659 'sleeping', | 658 'sleeping', |
| 660 """ | 659 """ |
| 661 import sys | 660 import sys |
| 662 import time | 661 import time |
| 663 time.sleep(300) | 662 time.sleep(300) |
| 664 sys.exit(0) | 663 sys.exit(0) |
| 665 """) | 664 """) |
| 666 elapsed_time = time.time() - start_time | |
| 667 if elapsed_time > 3 * 60 * 60: # pragma: no cover | |
| 668 # Timed out waiting for build | |
| 669 revision.status = revision.FAILED | |
| 670 else: | 665 else: |
| 671 break | 666 break |
| 672 | 667 |
| 673 def _update_candidate_range(self): | 668 def _update_candidate_range(self): |
| 674 """Updates lkgr and fkbr (last known good/first known bad) revisions. | 669 """Updates lkgr and fkbr (last known good/first known bad) revisions. |
| 675 | 670 |
| 676 lkgr and fkbr are 'pointers' to the appropriate RevisionState objects in | 671 lkgr and fkbr are 'pointers' to the appropriate RevisionState objects in |
| 677 bisectors.revisions.""" | 672 bisectors.revisions.""" |
| 678 for r in self.revisions: | 673 for r in self.revisions: |
| 679 if r.tested: | 674 if r.tested: |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 }) | 843 }) |
| 849 return revision_rows | 844 return revision_rows |
| 850 | 845 |
| 851 def _get_build_url(self): | 846 def _get_build_url(self): |
| 852 properties = self.api.m.properties | 847 properties = self.api.m.properties |
| 853 bot_url = properties.get('buildbotURL', | 848 bot_url = properties.get('buildbotURL', |
| 854 'http://build.chromium.org/p/chromium/') | 849 'http://build.chromium.org/p/chromium/') |
| 855 builder_name = urllib.quote(properties.get('buildername', '')) | 850 builder_name = urllib.quote(properties.get('buildername', '')) |
| 856 builder_number = str(properties.get('buildnumber', '')) | 851 builder_number = str(properties.get('buildnumber', '')) |
| 857 return '%sbuilders/%s/builds/%s' % (bot_url, builder_name, builder_number) | 852 return '%sbuilders/%s/builds/%s' % (bot_url, builder_name, builder_number) |
| OLD | NEW |