Bug 1365350: make uploader task a dependency of tests. r=dustin draft
authorWander Lairson Costa <wcosta@mozilla.com>
Wed, 17 May 2017 17:42:21 -0300
changeset 579845 84c5ba020daf072b434eb916a1f82400bcdc7a02
parent 579844 b133ec74e3d0813c0951603209fa283ef0efd8b2
child 629126 163589c830bab6ce3ac5e6510cb09de133729ff0
push id59378
push userwcosta@mozilla.com
push dateWed, 17 May 2017 20:42:41 +0000
reviewersdustin
bugs1365350
milestone55.0a1
Bug 1365350: make uploader task a dependency of tests. r=dustin For some reason, tests sometimes start before uploader task is finished, we then make it a dependency to avoid the bug. MozReview-Commit-ID: JlA471DUYPN
taskcluster/taskgraph/morph.py
--- a/taskcluster/taskgraph/morph.py
+++ b/taskcluster/taskgraph/morph.py
@@ -185,29 +185,27 @@ def make_s3_uploader_task(parent_task):
     dependencies = {}
     task = Task(kind='misc', label=label, attributes={}, task=task_def,
                 dependencies=dependencies)
     task.task_id = parent_task.task['payload']['properties']['upload_to_task_id']
     return task
 
 
 def update_test_tasks(taskid, build_taskid, taskgraph):
-    """Tests task must download artifacts from uploader task.
-
-    Notice they don't need to depend on uploader task because it finishes
-    before the build task.
-    """
+    """Tests task must download artifacts from uploader task."""
     # Notice we handle buildbot-bridge, native, and generic-worker payloads
     # We can do better here in terms of graph searching
     # We could do post order search and stop as soon as we
     # reach the build task. Not worring about it because this is
     # (supposed to be) a temporary solution.
     for task in taskgraph.tasks.itervalues():
         if build_taskid in task.task.get('dependencies', []):
             payload = task.task['payload']
+            task.task['dependencies'].append(taskid)
+            taskgraph.graph.edges.add((task.task_id, taskid, 'uploader'))
             if 'command' in payload:
                 try:
                     payload['command'] = [
                         cmd.replace(build_taskid, taskid) for cmd in payload['command']
                     ]
                 except AttributeError:
                     # generic-worker command attribute is an list of lists
                     payload['command'] = [