aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-24 08:20:03 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-24 08:20:03 -0700
commitd978a95d3cb9b2edf26efa2a9a5942192524209c (patch)
treebef03d2c2fce5efafebf264e6f17d0c15a6b6f6e /tools
parent26f6c1b2390deab5f891003b448793a63bd09130 (diff)
parent7e0e18d21e996c1bed242bca8eacb559527f95e3 (diff)
Merge github.com:grpc/grpc into hybrid
Diffstat (limited to 'tools')
-rw-r--r--tools/grpcz/BUILD13
-rwxr-xr-xtools/profiling/microbenchmarks/bm2bq.py2
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff.py1
-rw-r--r--tools/run_tests/generated/sources_and_headers.json17
-rw-r--r--tools/run_tests/generated/tests.json45
-rwxr-xr-xtools/run_tests/python_utils/jobset.py14
-rwxr-xr-xtools/run_tests/run_tests.py7
-rwxr-xr-xtools/run_tests/run_tests_matrix.py5
8 files changed, 91 insertions, 13 deletions
diff --git a/tools/grpcz/BUILD b/tools/grpcz/BUILD
index cac7df2a9d..cc887a5375 100644
--- a/tools/grpcz/BUILD
+++ b/tools/grpcz/BUILD
@@ -33,30 +33,31 @@ package(default_visibility = ["//visibility:public"])
load("//:bazel/grpc_build_system.bzl", "grpc_proto_library")
-grpc_proto_library (
+grpc_proto_library(
name = "monitoring_proto",
srcs = [
"monitoring.proto",
],
+ well_known_protos = "@com_google_protobuf//:well_known_protos",
deps = [
":census_proto",
],
- well_known_protos = "@submodule_protobuf//:well_known_protos",
)
-grpc_proto_library (
+grpc_proto_library(
name = "census_proto",
srcs = [
"census.proto",
],
- well_known_protos = "@submodule_protobuf//:well_known_protos",
+ well_known_protos = "@com_google_protobuf//:well_known_protos",
)
cc_binary(
name = "grpcz_client",
- srcs = ["grpcz_client.cc",],
+ srcs = ["grpcz_client.cc"],
deps = [
- "//external:gflags",
"monitoring_proto",
+ "//external:gflags",
+ "@mongoose_repo//:mongoose_lib",
],
)
diff --git a/tools/profiling/microbenchmarks/bm2bq.py b/tools/profiling/microbenchmarks/bm2bq.py
index ffb11f57d8..99cf4a558c 100755
--- a/tools/profiling/microbenchmarks/bm2bq.py
+++ b/tools/profiling/microbenchmarks/bm2bq.py
@@ -71,6 +71,7 @@ columns = [
('end_of_stream', 'boolean'),
('header_bytes_per_iteration', 'float'),
('framing_bytes_per_iteration', 'float'),
+ ('nows_per_iteration', 'float'),
]
SANITIZE = {
@@ -103,4 +104,3 @@ for row in bm_json.expand_json(js, js2):
if row[name] == '': continue
sane_row[name] = SANITIZE[sql_type](row[name])
writer.writerow(sane_row)
-
diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py
index 09b62ae1c9..6ee4cbfc7b 100755
--- a/tools/profiling/microbenchmarks/bm_diff.py
+++ b/tools/profiling/microbenchmarks/bm_diff.py
@@ -56,6 +56,7 @@ _INTERESTING = (
'writes_per_iteration',
'atm_cas_per_iteration',
'atm_add_per_iteration',
+ 'nows_per_iteration',
)
def changed_ratio(n, o):
diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json
index 70e26194e7..f525faab9c 100644
--- a/tools/run_tests/generated/sources_and_headers.json
+++ b/tools/run_tests/generated/sources_and_headers.json
@@ -1988,6 +1988,23 @@
"headers": [],
"is_filegroup": false,
"language": "c",
+ "name": "slice_hash_table_test",
+ "src": [
+ "test/core/slice/slice_hash_table_test.c"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "is_filegroup": false,
+ "language": "c",
"name": "slice_string_helpers_test",
"src": [
"test/core/slice/slice_string_helpers_test.c"
diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json
index 38bfb2fcdb..96f4af6042 100644
--- a/tools/run_tests/generated/tests.json
+++ b/tools/run_tests/generated/tests.json
@@ -2085,6 +2085,28 @@
"flaky": false,
"gtest": false,
"language": "c",
+ "name": "slice_hash_table_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ]
+ },
+ {
+ "args": [],
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "exclude_iomgrs": [],
+ "flaky": false,
+ "gtest": false,
+ "language": "c",
"name": "slice_string_helpers_test",
"platforms": [
"linux",
@@ -85167,6 +85189,29 @@
},
{
"args": [
+ "test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6462055064272896"
+ ],
+ "ci_platforms": [
+ "linux"
+ ],
+ "cpu_cost": 0.1,
+ "exclude_configs": [
+ "tsan"
+ ],
+ "exclude_iomgrs": [
+ "uv"
+ ],
+ "flaky": false,
+ "language": "c",
+ "name": "api_fuzzer_one_entry",
+ "platforms": [
+ "mac",
+ "linux"
+ ],
+ "uses_polling": false
+ },
+ {
+ "args": [
"test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6499902139924480"
],
"ci_platforms": [
diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py
index 5d812f28ee..460f359cf3 100755
--- a/tools/run_tests/python_utils/jobset.py
+++ b/tools/run_tests/python_utils/jobset.py
@@ -348,7 +348,7 @@ class Jobset(object):
"""Manages one run of jobs."""
def __init__(self, check_cancelled, maxjobs, newline_on_success, travis,
- stop_on_failure, add_env, quiet_success):
+ stop_on_failure, add_env, quiet_success, max_time):
self._running = set()
self._check_cancelled = check_cancelled
self._cancelled = False
@@ -360,6 +360,7 @@ class Jobset(object):
self._stop_on_failure = stop_on_failure
self._add_env = add_env
self._quiet_success = quiet_success
+ self._max_time = max_time
self.resultset = {}
self._remaining = None
self._start_time = time.time()
@@ -379,6 +380,12 @@ class Jobset(object):
def start(self, spec):
"""Start a job. Return True on success, False on failure."""
while True:
+ if self._max_time > 0 and time.time() - self._start_time > self._max_time:
+ skipped_job_result = JobResult()
+ skipped_job_result.state = 'SKIPPED'
+ message('SKIPPED', spec.shortname, do_newline=True)
+ self.resultset[spec.shortname] = [skipped_job_result]
+ return True
if self.cancelled(): return False
current_cpu_cost = self.cpu_cost()
if current_cpu_cost == 0: break
@@ -474,7 +481,8 @@ def run(cmdlines,
stop_on_failure=False,
add_env={},
skip_jobs=False,
- quiet_success=False):
+ quiet_success=False,
+ max_time=-1):
if skip_jobs:
resultset = {}
skipped_job_result = JobResult()
@@ -486,7 +494,7 @@ def run(cmdlines,
js = Jobset(check_cancelled,
maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS,
newline_on_success, travis, stop_on_failure, add_env,
- quiet_success)
+ quiet_success, max_time)
for cmdline, remaining in tag_remaining(cmdlines):
if not js.start(cmdline):
break
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 09b700a9b2..a1ec1b2f45 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -1210,6 +1210,7 @@ argp.add_argument('--quiet_success',
'Useful when running many iterations of each test (argument -n).')
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')
+argp.add_argument('--max_time', default=-1, type=int, help='Maximum test runtime in seconds')
args = argp.parse_args()
if args.force_default_poller:
@@ -1465,8 +1466,8 @@ def _build_and_run(
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:
- massaged_one_run = sorted(one_run, key=lambda x: (x.cpu_cost, x.shortname))
+ if args.travis and args.max_time <= 0:
+ massaged_one_run = sorted(one_run, key=lambda x: x.shortname)
else:
# whereas otherwise, we want to shuffle things up to give all tests a
# chance to run.
@@ -1493,7 +1494,7 @@ def _build_and_run(
all_runs, check_cancelled, newline_on_success=newline_on_success,
travis=args.travis, maxjobs=args.jobs,
stop_on_failure=args.stop_on_failure,
- quiet_success=args.quiet_success)
+ quiet_success=args.quiet_success, max_time=args.max_time)
if resultset:
for k, v in sorted(resultset.items()):
num_runs, num_failures = _calculate_num_runs_failures(v)
diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py
index 1da754d9f8..02f0ec5eff 100755
--- a/tools/run_tests/run_tests_matrix.py
+++ b/tools/run_tests/run_tests_matrix.py
@@ -377,6 +377,9 @@ if __name__ == "__main__":
argp.add_argument('-n', '--runs_per_test', default=1, type=_runs_per_test_type,
help='How many times to run each tests. >1 runs implies ' +
'omitting passing test from the output & reports.')
+ argp.add_argument('--max_time', default=-1, type=int,
+ help='Maximum amount of time to run tests for' +
+ '(other tests will be skipped)')
args = argp.parse_args()
extra_args = []
@@ -388,6 +391,8 @@ if __name__ == "__main__":
extra_args.append('-n')
extra_args.append('%s' % args.runs_per_test)
extra_args.append('--quiet_success')
+ if args.max_time > 0:
+ extra_args.extend(('--max_time', '%d' % args.max_time))
all_jobs = _create_test_jobs(extra_args=extra_args, inner_jobs=args.inner_jobs) + \
_create_portability_test_jobs(extra_args=extra_args, inner_jobs=args.inner_jobs)