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

Unified Diff: appengine/swarming/server/task_result.py

Issue 2298053002: Add more safety checks. (Closed)
Patch Set: More check Created 4 years, 4 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
Index: appengine/swarming/server/task_result.py
diff --git a/appengine/swarming/server/task_result.py b/appengine/swarming/server/task_result.py
index 07d64ccb0967001a610111a6f4a2b54be6911120..261cab1f0c2c1f1ffc1226526c45fe02cf91c4b7 100644
--- a/appengine/swarming/server/task_result.py
+++ b/appengine/swarming/server/task_result.py
@@ -636,10 +636,11 @@ class _TaskResultCommon(ndb.Model):
if self.deduped_from:
if self.state != State.COMPLETED:
raise datastore_errors.BadValueError(
- 'state must be COMPLETED on deduped task')
+ 'state(%d) must be COMPLETED on deduped task %s' %
+ (self.state, self.deduped_from))
if self.failure:
raise datastore_errors.BadValueError(
- 'failure can\'t be True on deduped task')
+ 'failure can\'t be True on deduped task %s' % self.deduped_from)
self.children_task_ids = sorted(
set(self.children_task_ids), key=lambda x: int(x, 16))
« no previous file with comments | « no previous file | appengine/swarming/server/task_scheduler.py » ('j') | appengine/swarming/server/task_scheduler.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698