|
6 | 6 |
|
7 | 7 | """Utility functions to handle test chunking."""
|
8 | 8 |
|
9 |
| -import os |
10 | 9 | import json
|
| 10 | +import logging |
| 11 | +import os |
11 | 12 | from abc import ABCMeta, abstractmethod
|
12 | 13 |
|
13 | 14 | import six
|
|
22 | 23 |
|
23 | 24 | from taskgraph import GECKO
|
24 | 25 | from taskgraph.util.backstop import is_backstop
|
25 |
| -from taskgraph.util.bugbug import CT_LOW, push_schedules |
| 26 | +from taskgraph.util.bugbug import BugbugTimeoutException, CT_LOW, push_schedules |
26 | 27 |
|
| 28 | +logger = logging.getLogger(__name__) |
27 | 29 | here = os.path.abspath(os.path.dirname(__file__))
|
28 | 30 | resolver = TestResolver.from_environment(cwd=here, loader_cls=TestManifestLoader)
|
29 | 31 |
|
@@ -210,15 +212,25 @@ class BugbugLoader(DefaultLoader):
|
210 | 212 | filter them based on a query to bugbug."""
|
211 | 213 | CONFIDENCE_THRESHOLD = CT_LOW
|
212 | 214 |
|
| 215 | + def __init__(self, *args, **kwargs): |
| 216 | + super(BugbugLoader, self).__init__(*args, **kwargs) |
| 217 | + self.timedout = False |
| 218 | + |
213 | 219 | @memoize
|
214 | 220 | def get_manifests(self, suite, mozinfo):
|
215 | 221 | manifests = super(BugbugLoader, self).get_manifests(suite, mozinfo)
|
216 | 222 |
|
217 |
| - # Don't prune any manifests if we're on a backstop push. |
218 |
| - if is_backstop(self.params): |
| 223 | + # Don't prune any manifests if we're on a backstop push or there was a timeout. |
| 224 | + if is_backstop(self.params) or self.timedout: |
219 | 225 | return manifests
|
220 | 226 |
|
221 |
| - data = push_schedules(self.params['project'], self.params['head_rev']) |
| 227 | + try: |
| 228 | + data = push_schedules(self.params['project'], self.params['head_rev']) |
| 229 | + except BugbugTimeoutException: |
| 230 | + logger.warning("Timed out waiting for bugbug, loading all test manifests.") |
| 231 | + self.timedout = True |
| 232 | + return self.get_manifests(suite, mozinfo) |
| 233 | + |
222 | 234 | bugbug_manifests = {m for m, c in data.get('groups', {}).items()
|
223 | 235 | if c >= self.CONFIDENCE_THRESHOLD}
|
224 | 236 |
|
|
0 commit comments