| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import collections | 5 import collections |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import traceback | 8 import traceback |
| 9 | 9 |
| 10 from google.appengine.api import taskqueue | 10 from google.appengine.api import taskqueue |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 def Start(self): | 112 def Start(self): |
| 113 self.Schedule() | 113 self.Schedule() |
| 114 self._PostBugComment('started', send_email=False) | 114 self._PostBugComment('started', send_email=False) |
| 115 | 115 |
| 116 def Complete(self): | 116 def Complete(self): |
| 117 self._PostBugComment('completed', include_differences=True) | 117 self._PostBugComment('completed', include_differences=True) |
| 118 | 118 |
| 119 def Fail(self): | 119 def Fail(self): |
| 120 self.exception = traceback.format_exc() | 120 self.exception = traceback.format_exc() |
| 121 self._PostBugComment('stopped with an error', include_differences=True) | 121 self._PostBugComment('stopped with an error') |
| 122 | 122 |
| 123 def Schedule(self): | 123 def Schedule(self): |
| 124 task = taskqueue.add(queue_name='job-queue', url='/api/run/' + self.job_id, | 124 task = taskqueue.add(queue_name='job-queue', url='/api/run/' + self.job_id, |
| 125 countdown=_TASK_INTERVAL) | 125 countdown=_TASK_INTERVAL) |
| 126 self.task = task.name | 126 self.task = task.name |
| 127 | 127 |
| 128 def Run(self): | 128 def Run(self): |
| 129 self.exception = None # In case the Job succeeds on retry. | 129 self.exception = None # In case the Job succeeds on retry. |
| 130 self.task = None # In case an exception is thrown. | 130 self.task = None # In case an exception is thrown. |
| 131 | 131 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 | 386 |
| 387 try: | 387 try: |
| 388 p_value = mann_whitney_u.MannWhitneyU(values_a, values_b) | 388 p_value = mann_whitney_u.MannWhitneyU(values_a, values_b) |
| 389 except ValueError: | 389 except ValueError: |
| 390 return _UNKNOWN | 390 return _UNKNOWN |
| 391 | 391 |
| 392 if p_value < _SIGNIFICANCE_LEVEL: | 392 if p_value < _SIGNIFICANCE_LEVEL: |
| 393 return _DIFFERENT | 393 return _DIFFERENT |
| 394 else: | 394 else: |
| 395 return _UNKNOWN | 395 return _UNKNOWN |
| OLD | NEW |