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

Unified Diff: sharding_supervisor.py

Issue 10084032: Handle the case where a shard crashed and did not generate an xml file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/tools/sharding_supervisor/
Patch Set: Created 8 years, 8 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: sharding_supervisor.py
===================================================================
--- sharding_supervisor.py (revision 132342)
+++ sharding_supervisor.py (working copy)
@@ -103,9 +103,14 @@
"""Combine the shard xml file with the final xml file."""
path = generic_path + str(shard)
- with open(path) as shard_xml_file:
- shard_xml = minidom.parse(shard_xml_file)
+ try:
+ with open(path) as shard_xml_file:
+ shard_xml = minidom.parse(shard_xml_file)
+ except IOError:
+ # If the shard crashed, gtest will not have generated an xml file.
+ return final_xml
+
if not final_xml:
# Out final xml is empty, let's prepopulate it with the first one we see.
return shard_xml
@@ -369,9 +374,11 @@
final_xml = None
for i in range(start_point, start_point + self.num_shards_to_run):
final_xml = AppendToXML(final_xml, xml_path, i)
- with open(xml_path, 'w') as final_file:
- final_xml.writexml(final_file)
+ if final_xml:
+ with open(xml_path, 'w') as final_file:
+ final_xml.writexml(final_file)
+
num_failed = len(self.failed_shards)
if num_failed > 0:
self.failed_shards.sort()
« 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