Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: appengine/findit/waterfall/swarming_util.py

Issue 2312413002: [Findit] Record error if swarming task completes with exit_code as 2. (Closed)
Patch Set: Add None check to avoid keyvalue error (related change) Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import base64 5 import base64
6 from collections import defaultdict 6 from collections import defaultdict
7 import json 7 import json
8 import logging 8 import logging
9 import urllib 9 import urllib
10 import zlib 10 import zlib
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return step_isolated_data 206 return step_isolated_data
207 207
208 208
209 def _FetchOutputJsonInfoFromIsolatedServer(isolated_data, http_client): 209 def _FetchOutputJsonInfoFromIsolatedServer(isolated_data, http_client):
210 """Sends POST request to isolated server and returns response content. 210 """Sends POST request to isolated server and returns response content.
211 211
212 This function is used for fetching 212 This function is used for fetching
213 1. hash code for the output.json file, 213 1. hash code for the output.json file,
214 2. the redirect url. 214 2. the redirect url.
215 """ 215 """
216 if not isolated_data:
217 return None
218
216 post_data = { 219 post_data = {
217 'digest': isolated_data['digest'], 220 'digest': isolated_data['digest'],
218 'namespace': { 221 'namespace': {
219 'namespace': isolated_data['namespace'] 222 'namespace': isolated_data['namespace']
220 } 223 }
221 } 224 }
222 url = '%s/_ah/api/isolateservice/v1/retrieve' % ( 225 url = '%s/_ah/api/isolateservice/v1/retrieve' % (
223 isolated_data['isolatedserver']) 226 isolated_data['isolatedserver'])
224 content = _SendRequestToServer(url, http_client, post_data) 227 content = _SendRequestToServer(url, http_client, post_data)
225 return content 228 return content
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 shard_results = [] 353 shard_results = []
351 for isolated_data in list_isolated_data: 354 for isolated_data in list_isolated_data:
352 output_json = _DownloadTestResults(isolated_data, http_client) 355 output_json = _DownloadTestResults(isolated_data, http_client)
353 if not output_json: 356 if not output_json:
354 return None 357 return None
355 shard_results.append(output_json) 358 shard_results.append(output_json)
356 359
357 if len(list_isolated_data) == 1: 360 if len(list_isolated_data) == 1:
358 return shard_results[0] 361 return shard_results[0]
359 return _MergeSwarmingTestShards(shard_results) 362 return _MergeSwarmingTestShards(shard_results)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698