Bug 1336423 - Reduce warnings for SETA; r?jmaher
MozReview-Commit-ID: 5npX51kX2hB
--- a/taskcluster/taskgraph/util/seta.py
+++ b/taskcluster/taskgraph/util/seta.py
@@ -42,17 +42,16 @@ class SETA(object):
if len(task_tuple) != 3:
return ' '.join(task_tuple)
return 'test-%s/%s-%s' % (task_tuple[0], task_tuple[1], task_tuple[2])
def query_low_value_tasks(self, project):
# Request the set of low value tasks from the SETA service. Low value tasks will be
# optimized out of the task graph.
- logger.debug("Querying SETA service for low-value tasks on {}".format(project))
low_value_tasks = []
url = SETA_ENDPOINT % project
# Try to fetch the SETA data twice, falling back to an empty list of low value tasks.
# There are 10 seconds between each try.
try:
logger.debug("Retrieving low-value jobs list from SETA")
response = retry(requests.get, attempts=2, sleeptime=10,
@@ -116,17 +115,16 @@ class SETA(object):
# if we already tried to retrieve the datetime for this pushid
# before and the json-push request failed, don't try it again
if prev_push_id in self.failed_json_push_calls:
return min_between_pushes
url = PUSH_ENDPOINT % (project, cur_push_id - 2, prev_push_id)
try:
- logger.debug("Retrieving datetime of previous push")
response = retry(requests.get, attempts=2, sleeptime=10,
args=(url, ),
kwargs={'timeout': 5, 'headers': headers})
prev_push_date = json.loads(response.content).get(str(prev_push_id), {}).get('date', 0)
# cache it for next time
self.push_dates[project].update({prev_push_id: prev_push_date})
@@ -161,17 +159,16 @@ class SETA(object):
logger.warning(error)
self.failed_json_push_calls.append(prev_push_id)
return min_between_pushes
def is_low_value_task(self, label, project, pushlog_id, push_date):
# marking a task as low_value means it will be optimized out by tc
if project not in SETA_PROJECTS:
- logger.debug("SETA is not enabled for project `{}`".format(project))
return False
schedule_all_every = PROJECT_SCHEDULE_ALL_EVERY_PUSHES.get(project, 5)
# on every Nth push, want to run all tasks
if int(pushlog_id) % schedule_all_every == 0:
return False
# Nth push, so time to call seta based on number of pushes; however