| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 """Task queue endpoints for creating and updating issues on issue tracker.""" | 5 """Task queue endpoints for creating and updating issues on issue tracker.""" |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import urllib2 | 10 import urllib2 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 'http://test-results.appspot.com/testfile?builder=%(buildername)s&name=' | 64 'http://test-results.appspot.com/testfile?builder=%(buildername)s&name=' |
| 65 'full_results.json&master=%(mastername)s&testtype=%(stepname)s&buildnumber=' | 65 'full_results.json&master=%(mastername)s&testtype=%(stepname)s&buildnumber=' |
| 66 '%(buildnumber)s') | 66 '%(buildnumber)s') |
| 67 VERY_STALE_FLAKES_MESSAGE = ( | 67 VERY_STALE_FLAKES_MESSAGE = ( |
| 68 'Reporting to stale-flakes-reports@google.com to investigate why this ' | 68 'Reporting to stale-flakes-reports@google.com to investigate why this ' |
| 69 'issue is not being processed despite being in an appropriate queue.') | 69 'issue is not being processed despite being in an appropriate queue.') |
| 70 STALE_FLAKES_ML = 'stale-flakes-reports@google.com' | 70 STALE_FLAKES_ML = 'stale-flakes-reports@google.com' |
| 71 MAX_GAP_FOR_FLAKINESS_PERIOD = datetime.timedelta(days=3) | 71 MAX_GAP_FOR_FLAKINESS_PERIOD = datetime.timedelta(days=3) |
| 72 KNOWN_TROOPER_FAILURES = [ | 72 KNOWN_TROOPER_FAILURES = [ |
| 73 'analyze', 'bot_update', 'compile (with patch)', 'compile', | 73 'analyze', 'bot_update', 'compile (with patch)', 'compile', |
| 74 'device_status_check', 'gclient runhooks (with patch)', 'Patch failure', | 74 'device_status_check', 'gclient runhooks (with patch)', 'Patch', |
| 75 'process_dumps', 'provision_devices', 'update_scripts'] | 75 'process_dumps', 'provision_devices', 'update_scripts'] |
| 76 | 76 |
| 77 | 77 |
| 78 def is_trooper_flake(flake_name): | 78 def is_trooper_flake(flake_name): |
| 79 return flake_name in KNOWN_TROOPER_FAILURES | 79 return flake_name in KNOWN_TROOPER_FAILURES |
| 80 | 80 |
| 81 | 81 |
| 82 def get_queue_details(flake_name): | 82 def get_queue_details(flake_name): |
| 83 if is_trooper_flake(flake_name): | 83 if is_trooper_flake(flake_name): |
| 84 return 'Trooper Bug Queue', 'Infra-Troopers' | 84 return 'Trooper Bug Queue', 'Infra-Troopers' |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 failure_run.buildnumber, step) | 557 failure_run.buildnumber, step) |
| 558 for flake in flakes: | 558 for flake in flakes: |
| 559 flake_occurrence = FlakeOccurrence(name=step_name, failure=flake) | 559 flake_occurrence = FlakeOccurrence(name=step_name, failure=flake) |
| 560 flaky_run.flakes.append(flake_occurrence) | 560 flaky_run.flakes.append(flake_occurrence) |
| 561 flakes_to_update.append(flake) | 561 flakes_to_update.append(flake) |
| 562 | 562 |
| 563 flaky_run_key = flaky_run.put() | 563 flaky_run_key = flaky_run.put() |
| 564 for flake in flakes_to_update: | 564 for flake in flakes_to_update: |
| 565 self.add_failure_to_flake(flake, flaky_run_key, failure_time) | 565 self.add_failure_to_flake(flake, flaky_run_key, failure_time) |
| 566 self.flaky_runs.increment_by(1) | 566 self.flaky_runs.increment_by(1) |
| OLD | NEW |