Skip to content

Commit d60afdf

Browse files
committed
Bug 1654591 - [taskgraph] Fallback all manifests if there was a timeout in the bugbug loader, r=marco
Differential Revision: https://phabricator.services.mozilla.com/D84835
1 parent 93de924 commit d60afdf

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

taskcluster/taskgraph/util/chunking.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
"""Utility functions to handle test chunking."""
88

9-
import os
109
import json
10+
import logging
11+
import os
1112
from abc import ABCMeta, abstractmethod
1213

1314
import six
@@ -22,8 +23,9 @@
2223

2324
from taskgraph import GECKO
2425
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
2627

28+
logger = logging.getLogger(__name__)
2729
here = os.path.abspath(os.path.dirname(__file__))
2830
resolver = TestResolver.from_environment(cwd=here, loader_cls=TestManifestLoader)
2931

@@ -210,15 +212,25 @@ class BugbugLoader(DefaultLoader):
210212
filter them based on a query to bugbug."""
211213
CONFIDENCE_THRESHOLD = CT_LOW
212214

215+
def __init__(self, *args, **kwargs):
216+
super(BugbugLoader, self).__init__(*args, **kwargs)
217+
self.timedout = False
218+
213219
@memoize
214220
def get_manifests(self, suite, mozinfo):
215221
manifests = super(BugbugLoader, self).get_manifests(suite, mozinfo)
216222

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:
219225
return manifests
220226

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+
222234
bugbug_manifests = {m for m, c in data.get('groups', {}).items()
223235
if c >= self.CONFIDENCE_THRESHOLD}
224236

0 commit comments

Comments
 (0)