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

Unified Diff: scripts/slave/recipe_modules/swarming/resources/collect_gtest_task.py

Issue 2372783002: Size limit gtest collect (Closed)
Patch Set: parens 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..778083005e9bff44f999e46578afe4d0f21d5909 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()
+
with open(path) as f:
return json.load(f)
except (IOError, ValueError):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698