diff options
Diffstat (limited to 'tools/run_tests/run_tests.py')
-rwxr-xr-x | tools/run_tests/run_tests.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 89782aec5c..47d4a28605 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -62,6 +62,11 @@ os.chdir(_ROOT) _FORCE_ENVIRON_FOR_WRAPPERS = {} +_POLLING_STRATEGIES = { + 'linux': ['epoll', 'poll', 'legacy'] +} + + def platform_string(): return jobset.platform_string() @@ -153,14 +158,8 @@ class CLanguage(object): def test_specs(self): out = [] binaries = get_c_tests(self.args.travis, self.test_lang) - POLLING_STRATEGIES = { - 'windows': ['all'], - 'mac': ['all'], - 'posix': ['all'], - 'linux': ['poll', 'epoll', 'legacy'], - } for target in binaries: - polling_strategies = (POLLING_STRATEGIES[self.platform] + polling_strategies = (_POLLING_STRATEGIES.get(self.platform, ['all']) if target.get('uses_polling', True) else ['all']) for polling_strategy in polling_strategies: @@ -395,7 +394,7 @@ class PythonLanguage(object): tests_json = json.load(tests_json_file) environment = dict(_FORCE_ENVIRON_FOR_WRAPPERS) environment['PYTHONPATH'] = '{}:{}'.format( - os.path.abspath('src/python/gens'), + os.path.abspath('src/python/gens'), os.path.abspath('src/python/grpcio_health_checking')) if self.config.build_config != 'gcov': return [self.config.job_spec( @@ -794,6 +793,7 @@ argp.add_argument('-n', '--runs_per_test', default=1, type=runs_per_test_type, help='A positive integer or "inf". If "inf", all tests will run in an ' 'infinite loop. Especially useful in combination with "-f"') argp.add_argument('-r', '--regex', default='.*', type=str) +argp.add_argument('--regex_exclude', default='', type=str) argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int) argp.add_argument('-s', '--slowdown', default=1.0, type=float) argp.add_argument('-f', '--forever', @@ -854,8 +854,13 @@ argp.add_argument('--update_submodules', default=[], nargs='*', argp.add_argument('-a', '--antagonists', default=0, type=int) argp.add_argument('-x', '--xml_report', default=None, type=str, help='Generates a JUnit-compatible XML report') +argp.add_argument('--force_default_poller', default=False, action='store_const', const=True, + help='Dont try to iterate over many polling strategies when they exist') args = argp.parse_args() +if args.force_default_poller: + _POLLING_STRATEGIES = {} + jobset.measure_cpu_costs = args.measure_cpu_costs # update submodules if necessary @@ -908,7 +913,7 @@ for l in languages: language_make_options=[] if any(language.make_options() for language in languages): - if len(languages) != 1: + if not 'gcov' in args.config and len(languages) != 1: print 'languages with custom make options cannot be built simultaneously with other languages' sys.exit(1) else: @@ -1205,7 +1210,9 @@ def _build_and_run( spec for language in languages for spec in language.test_specs() - if re.search(args.regex, spec.shortname)) + if (re.search(args.regex, spec.shortname) and + (args.regex_exclude == '' or + not re.search(args.regex_exclude, spec.shortname)))) # When running on travis, we want out test runs to be as similar as possible # for reproducibility purposes. if args.travis: @@ -1228,7 +1235,7 @@ def _build_and_run( cache=cache if not xml_report else None, add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port}) if resultset: - for k, v in resultset.iteritems(): + for k, v in sorted(resultset.items()): num_runs, num_failures = _calculate_num_runs_failures(v) if num_failures == num_runs: # what about infinite_runs??? jobset.message('FAILED', k, do_newline=True) |