Bug 1414924 - test-action-callback prints task definitions scrambled r=dustin
authorRail Aliiev <rail@mozilla.com>
Mon, 06 Nov 2017 16:29:35 -0500
changeset 443672 47849caec7a24a92b6a327f3f6db4d8a9ad86d58
parent 443671 5a9fa46f3cb93803d2fba2ad246de6c6d4aefc96
child 443673 28be6e4365d96a89a1250cd95eeb9c39568043dd
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1414924
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1414924 - test-action-callback prints task definitions scrambled r=dustin MozReview-Commit-ID: GiJsOiTVUXL
taskcluster/taskgraph/create.py
--- a/taskcluster/taskgraph/create.py
+++ b/taskcluster/taskgraph/create.py
@@ -59,17 +59,19 @@ def create_tasks(taskgraph, label_to_tas
         # loop fails halfway through, none of the already-created tasks run.
         if decision_task_id:
             if not any(t in taskgraph.tasks for t in task_def.get('dependencies', [])):
                 task_def.setdefault('dependencies', []).append(decision_task_id)
 
         task_def['taskGroupId'] = task_group_id
         task_def['schedulerId'] = scheduler_id
 
-    with futures.ThreadPoolExecutor(CONCURRENCY) as e:
+    # If `testing` is True, then run without parallelization
+    concurrency = CONCURRENCY if not testing else 1
+    with futures.ThreadPoolExecutor(concurrency) as e:
         fs = {}
 
         # We can't submit a task until its dependencies have been submitted.
         # So our strategy is to walk the graph and submit tasks once all
         # their dependencies have been submitted.
         tasklist = set(taskgraph.graph.visit_postorder())
         alltasks = tasklist.copy()
 
@@ -124,16 +126,18 @@ def create_task(session, task_id, label,
 
     # Resolve timestamps
     now = current_json_time(datetime_format=True)
     task_def = resolve_timestamps(now, task_def)
 
     if testing:
         json.dump([task_id, task_def], sys.stdout,
                   sort_keys=True, indent=4, separators=(',', ': '))
+        # add a newline
+        print("")
         return
 
     logger.debug("Creating task with taskId {} for {}".format(task_id, label))
     res = session.put('http://taskcluster/queue/v1/task/{}'.format(task_id),
                       data=json.dumps(task_def))
     if res.status_code != 200:
         try:
             logger.error(res.json()['message'])