Chromium Code Reviews| 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 copy | 5 import copy |
| 6 import logging | 6 import logging |
| 7 import time | 7 import time |
| 8 | 8 |
| 9 from common.http_client_appengine import HttpClientAppengine as HttpClient | 9 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| 10 from common.pipeline_wrapper import BasePipeline | 10 from common.pipeline_wrapper import BasePipeline |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 # Make a copy of the referred request and drop or overwrite some fields. | 33 # Make a copy of the referred request and drop or overwrite some fields. |
| 34 new_request = copy.deepcopy(ref_request) | 34 new_request = copy.deepcopy(ref_request) |
| 35 new_request.name = self._GetSwarmingTaskName(ref_task_id) | 35 new_request.name = self._GetSwarmingTaskName(ref_task_id) |
| 36 new_request.parent_task_id = '' | 36 new_request.parent_task_id = '' |
| 37 new_request.user = '' | 37 new_request.user = '' |
| 38 | 38 |
| 39 # To force a fresh re-run and ignore cached result of any equivalent run. | 39 # To force a fresh re-run and ignore cached result of any equivalent run. |
| 40 new_request.idempotent = False | 40 new_request.idempotent = False |
| 41 | 41 |
| 42 # Set the gtest_filter to run the given tests only. | 42 # Set the gtest_filter to run the given tests only. |
| 43 # Remove existing test filter first. | |
| 44 new_request.extra_args = [ | |
| 45 a for a in new_request.extra_args if ( | |
| 46 not a.startswith('--gtest_filter') and | |
|
lijeffrey
2016/11/29 05:51:30
So I'm not actually familiar with these flags, whe
stgao
2016/11/29 07:38:53
For gtest_filter, you may search on gtest document
| |
| 47 not a.startswith('--test-launcher-filter-file')) | |
| 48 ] | |
| 49 new_request.extra_args.append('--gtest_filter=%s' % ':'.join(tests)) | |
| 43 new_request.extra_args.append('--gtest_repeat=%s' % iterations) | 50 new_request.extra_args.append('--gtest_repeat=%s' % iterations) |
| 44 new_request.extra_args.append('--test-launcher-retry-limit=0') | 51 new_request.extra_args.append('--test-launcher-retry-limit=0') |
| 45 new_request.extra_args = [ | 52 |
| 46 a for a in new_request.extra_args if not a.startswith('--gtest_filter') | 53 # Also rerun disabled tests. Scenario: |
| 47 ] | 54 # 1. A gtest becomes flaky. |
| 48 new_request.extra_args.append('--gtest_filter=%s' % ':'.join(tests)) | 55 # 2. It is disabled, but no culprit is identified. |
| 56 # 3. Some dev starts investigation and requests Findit to analyze. | |
| 57 # 4. From the starting build, the test is already disabled. | |
| 58 # This scenario could happen if the flaky test didn't trigger an analysis | |
| 59 # before it is disabled. | |
| 60 new_request.extra_args.append('--gtest_also_run_disabled_tests') | |
|
chanli
2016/11/29 05:04:48
Question: for more general cases, shouldn't we sto
stgao
2016/11/29 07:38:53
Two questions before I could answer your question
chanli
2016/11/29 17:52:32
IIUC, we don't treat disabling a flaky test as a s
stgao
2016/11/29 18:09:36
No, disabling is just a temporary workaround.
| |
| 49 | 61 |
| 50 # Remove the env setting for sharding. | 62 # Remove the env setting for sharding. |
| 51 sharding_settings = ['GTEST_SHARD_INDEX', 'GTEST_TOTAL_SHARDS'] | 63 sharding_settings = ['GTEST_SHARD_INDEX', 'GTEST_TOTAL_SHARDS'] |
| 52 new_request.env = [ | 64 new_request.env = [ |
| 53 e for e in new_request.env if e['key'] not in sharding_settings | 65 e for e in new_request.env if e['key'] not in sharding_settings |
| 54 ] | 66 ] |
| 55 | 67 |
| 56 # Reset tags for searching and monitoring. | 68 # Reset tags for searching and monitoring. |
| 57 ref_name = swarming_util.GetTagValue(ref_request.tags, 'name') | 69 ref_name = swarming_util.GetTagValue(ref_request.tags, 'name') |
| 58 new_request.tags = [] | 70 new_request.tags = [] |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 swarming_task.error = error | 198 swarming_task.error = error |
| 187 else: | 199 else: |
| 188 logging.info('A Swarming task was triggered:%s', task_id) | 200 logging.info('A Swarming task was triggered:%s', task_id) |
| 189 | 201 |
| 190 swarming_task.put() | 202 swarming_task.put() |
| 191 | 203 |
| 192 # Call the hook function after the task is triggered. | 204 # Call the hook function after the task is triggered. |
| 193 self._OnTaskTriggered() | 205 self._OnTaskTriggered() |
| 194 | 206 |
| 195 return task_id | 207 return task_id |
| OLD | NEW |