aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-06-06 15:23:10 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-06-06 15:23:10 -0700
commit336c21eb454ff64facf3215178bf409f59fe8d9d (patch)
treee1afbd03aa40f5db3dd2531734476ab5763499ea /tools
parentfaafa4d1cb32574d9a7fd50eb52becf5eabab6ce (diff)
Use bigquery data to inform flakiness
Diffstat (limited to 'tools')
-rwxr-xr-xtools/run_tests/run_tests.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index a4aae489f8..8462b618fc 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -157,6 +157,9 @@ class Config(object):
actual_environ = self.environ.copy()
for k, v in environ.items():
actual_environ[k] = v
+ if not flaky and shortname and shortname in flaky_tests:
+ print('Setting %s to flaky' % shortname)
+ flaky = True
return jobset.JobSpec(cmdline=self.tool_prefix + cmdline,
shortname=shortname,
environ=actual_environ,
@@ -1251,9 +1254,15 @@ argp.add_argument('--bq_result_table',
nargs='?',
help='Upload test results to a specified BQ table.')
# XXX Remove the following line. Only used for proof-of-concept-ing
-argp.add_argument('--show_flakes', default=False, type=bool);
+argp.add_argument('--show_flakes', default=False, action='store_const', const=True);
args = argp.parse_args()
+try:
+ flaky_tests = set(get_flaky_tests())
+except:
+ print("Unexpected error getting flaky tests:", sys.exc_info()[0])
+ flaky_tests = set()
+
if args.show_flakes:
import pprint
pprint.pprint (get_flaky_tests())