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

Unified Diff: dashboard/dashboard/pinpoint/models/job.py

Issue 3008183002: [pinpoint] Separate Execution exceptions from result_values. (Closed)
Patch Set: Fix exception loop Created 3 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
Index: dashboard/dashboard/pinpoint/models/job.py
diff --git a/dashboard/dashboard/pinpoint/models/job.py b/dashboard/dashboard/pinpoint/models/job.py
index 27b2931ad6171afd41244a9e771d2a7bcc34def6..b184fdf0b8409d82c478eabf36bb23ef33df3d4f 100644
--- a/dashboard/dashboard/pinpoint/models/job.py
+++ b/dashboard/dashboard/pinpoint/models/job.py
@@ -284,7 +284,7 @@ class _JobState(object):
attempts = []
for c in self._changes:
- attempts.append([a.AsDict() for a in self._attempts[c]])
+ attempts.append([attempt.AsDict() for attempt in self._attempts[c]])
return {
'quests': map(str, self._quests),
@@ -301,10 +301,18 @@ class _JobState(object):
if any(not attempt.completed for attempt in attempts_a + attempts_b):
return _PENDING
+ # Compare exceptions.
+ exceptions_a = tuple(attempt.exception or '' for attempt in attempts_a)
+ exceptions_b = tuple(attempt.exception or '' for attempt in attempts_b)
+
+ if _CompareValues(exceptions_a, exceptions_b) == _DIFFERENT:
+ return _DIFFERENT
+
+ # Compare values.
results_a = _CombineResultsPerQuest(attempts_a)
results_b = _CombineResultsPerQuest(attempts_b)
- if any(_CompareResults(results_a[quest], results_b[quest]) == _DIFFERENT
+ if any(_CompareValues(results_a[quest], results_b[quest]) == _DIFFERENT
for quest in self._quests):
return _DIFFERENT
@@ -330,12 +338,12 @@ def _CombineResultsPerQuest(attempts):
return aggregate_results
-def _CompareResults(results_a, results_b):
- if len(results_a) == 0 or len(results_b) == 0:
+def _CompareValues(values_a, values_b):
+ if not (values_a and values_b):
return _UNKNOWN
try:
- p_value = mann_whitney_u.MannWhitneyU(results_a, results_b)
+ p_value = mann_whitney_u.MannWhitneyU(values_a, values_b)
except ValueError:
return _UNKNOWN
« no previous file with comments | « dashboard/dashboard/pinpoint/models/attempt.py ('k') | dashboard/dashboard/pinpoint/models/quest/execution.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698