Chromium Code Reviews| Index: scripts/slave/recipe_modules/swarming/resources/collect_gtest_task.py |
| diff --git a/scripts/slave/recipe_modules/swarming/resources/collect_gtest_task.py b/scripts/slave/recipe_modules/swarming/resources/collect_gtest_task.py |
| index cd82d3b1955c1a3f7debfabf33d5ee75ff4ca6de..073518b731558518ee6f0a225f832b4d32f0e6c0 100755 |
| --- a/scripts/slave/recipe_modules/swarming/resources/collect_gtest_task.py |
| +++ b/scripts/slave/recipe_modules/swarming/resources/collect_gtest_task.py |
| @@ -94,12 +94,18 @@ def merge_shard_results(output_dir): |
| merged[key] = sorted(merged[key]) |
| return merged |
| +OUTPUT_JSON_SIZE_LIMIT = 2e7 |
| + |
| def load_shard_json(output_dir, index): |
| """Reads JSON output of a single shard.""" |
| # 'output.json' is set in swarming/api.py, gtest_task method. |
| path = os.path.join(output_dir, str(index), 'output.json') |
| try: |
| + filesize = os.stat(path).st_size |
| + if filesize > OUTPUT_JSON_SIZE_LIMIT: |
| + raise ValueError |
|
M-A Ruel
2016/09/26 21:04:07
()
|
| + |
| with open(path) as f: |
| return json.load(f) |
| except (IOError, ValueError): |