aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Juanli Shen <juanlishen@google.com>2018-06-21 22:44:05 -0700
committerGravatar Juanli Shen <juanlishen@google.com>2018-06-22 10:00:48 -0700
commitf5f1d57d7abdd68c9037576729e3e85437aaa833 (patch)
tree9437b97cf60393bf853807ab1e347c1561affa1a /test
parent7a2a8ca4ba2cd505961ac43c656cc0a7a33c7bb0 (diff)
Add load reporting filter
Diffstat (limited to 'test')
-rw-r--r--test/core/end2end/end2end_nosec_tests.cc8
-rw-r--r--test/core/end2end/end2end_tests.cc8
-rw-r--r--test/core/end2end/fixtures/h2_load_reporting.cc120
-rwxr-xr-xtest/core/end2end/gen_build_yaml.py8
-rwxr-xr-xtest/core/end2end/generate_tests.bzl9
-rw-r--r--test/core/surface/public_headers_must_be_c89.c1
-rw-r--r--test/cpp/microbenchmarks/bm_call_create.cc11
7 files changed, 20 insertions, 145 deletions
diff --git a/test/core/end2end/end2end_nosec_tests.cc b/test/core/end2end/end2end_nosec_tests.cc
index 061b23b5d6..c6a4005fb3 100644
--- a/test/core/end2end/end2end_nosec_tests.cc
+++ b/test/core/end2end/end2end_nosec_tests.cc
@@ -88,8 +88,6 @@ extern void keepalive_timeout(grpc_end2end_test_config config);
extern void keepalive_timeout_pre_init(void);
extern void large_metadata(grpc_end2end_test_config config);
extern void large_metadata_pre_init(void);
-extern void load_reporting_hook(grpc_end2end_test_config config);
-extern void load_reporting_hook_pre_init(void);
extern void max_concurrent_streams(grpc_end2end_test_config config);
extern void max_concurrent_streams_pre_init(void);
extern void max_connection_age(grpc_end2end_test_config config);
@@ -220,7 +218,6 @@ void grpc_end2end_tests_pre_init(void) {
invoke_large_request_pre_init();
keepalive_timeout_pre_init();
large_metadata_pre_init();
- load_reporting_hook_pre_init();
max_concurrent_streams_pre_init();
max_connection_age_pre_init();
max_connection_idle_pre_init();
@@ -307,7 +304,6 @@ void grpc_end2end_tests(int argc, char **argv,
invoke_large_request(config);
keepalive_timeout(config);
large_metadata(config);
- load_reporting_hook(config);
max_concurrent_streams(config);
max_connection_age(config);
max_connection_idle(config);
@@ -476,10 +472,6 @@ void grpc_end2end_tests(int argc, char **argv,
large_metadata(config);
continue;
}
- if (0 == strcmp("load_reporting_hook", argv[i])) {
- load_reporting_hook(config);
- continue;
- }
if (0 == strcmp("max_concurrent_streams", argv[i])) {
max_concurrent_streams(config);
continue;
diff --git a/test/core/end2end/end2end_tests.cc b/test/core/end2end/end2end_tests.cc
index 7ae475cdef..7748a39cb5 100644
--- a/test/core/end2end/end2end_tests.cc
+++ b/test/core/end2end/end2end_tests.cc
@@ -90,8 +90,6 @@ extern void keepalive_timeout(grpc_end2end_test_config config);
extern void keepalive_timeout_pre_init(void);
extern void large_metadata(grpc_end2end_test_config config);
extern void large_metadata_pre_init(void);
-extern void load_reporting_hook(grpc_end2end_test_config config);
-extern void load_reporting_hook_pre_init(void);
extern void max_concurrent_streams(grpc_end2end_test_config config);
extern void max_concurrent_streams_pre_init(void);
extern void max_connection_age(grpc_end2end_test_config config);
@@ -223,7 +221,6 @@ void grpc_end2end_tests_pre_init(void) {
invoke_large_request_pre_init();
keepalive_timeout_pre_init();
large_metadata_pre_init();
- load_reporting_hook_pre_init();
max_concurrent_streams_pre_init();
max_connection_age_pre_init();
max_connection_idle_pre_init();
@@ -311,7 +308,6 @@ void grpc_end2end_tests(int argc, char **argv,
invoke_large_request(config);
keepalive_timeout(config);
large_metadata(config);
- load_reporting_hook(config);
max_concurrent_streams(config);
max_connection_age(config);
max_connection_idle(config);
@@ -484,10 +480,6 @@ void grpc_end2end_tests(int argc, char **argv,
large_metadata(config);
continue;
}
- if (0 == strcmp("load_reporting_hook", argv[i])) {
- load_reporting_hook(config);
- continue;
- }
if (0 == strcmp("max_concurrent_streams", argv[i])) {
max_concurrent_streams(config);
continue;
diff --git a/test/core/end2end/fixtures/h2_load_reporting.cc b/test/core/end2end/fixtures/h2_load_reporting.cc
deleted file mode 100644
index 18ea10a8d2..0000000000
--- a/test/core/end2end/fixtures/h2_load_reporting.cc
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "test/core/end2end/end2end_tests.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/http/server/http_server_filter.h"
-#include "src/core/ext/filters/load_reporting/server_load_reporting_plugin.h"
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/gpr/host_port.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/server.h"
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-
-typedef struct load_reporting_fixture_data {
- char* localaddr;
-} load_reporting_fixture_data;
-
-static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting(
- grpc_channel_args* client_args, grpc_channel_args* server_args) {
- grpc_end2end_test_fixture f;
- int port = grpc_pick_unused_port_or_die();
- load_reporting_fixture_data* ffd = static_cast<load_reporting_fixture_data*>(
- gpr_malloc(sizeof(load_reporting_fixture_data)));
- memset(&f, 0, sizeof(f));
-
- gpr_join_host_port(&ffd->localaddr, "localhost", port);
-
- f.fixture_data = ffd;
- f.cq = grpc_completion_queue_create_for_next(nullptr);
- f.shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr);
-
- return f;
-}
-
-void chttp2_init_client_load_reporting(grpc_end2end_test_fixture* f,
- grpc_channel_args* client_args) {
- load_reporting_fixture_data* ffd =
- static_cast<load_reporting_fixture_data*>(f->fixture_data);
- f->client =
- grpc_insecure_channel_create(ffd->localaddr, client_args, nullptr);
- GPR_ASSERT(f->client);
-}
-
-void chttp2_init_server_load_reporting(grpc_end2end_test_fixture* f,
- grpc_channel_args* server_args) {
- load_reporting_fixture_data* ffd =
- static_cast<load_reporting_fixture_data*>(f->fixture_data);
- grpc_arg arg = grpc_load_reporting_enable_arg();
- if (f->server) {
- grpc_server_destroy(f->server);
- }
- server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
- f->server = grpc_server_create(server_args, nullptr);
- {
- grpc_core::ExecCtx exec_ctx;
- grpc_channel_args_destroy(server_args);
- }
- grpc_server_register_completion_queue(f->server, f->cq, nullptr);
- GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr));
- grpc_server_start(f->server);
-}
-
-void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture* f) {
- load_reporting_fixture_data* ffd =
- static_cast<load_reporting_fixture_data*>(f->fixture_data);
- gpr_free(ffd->localaddr);
- gpr_free(ffd);
-}
-
-/* All test configurations */
-static grpc_end2end_test_config configs[] = {
- {"chttp2/fullstack+load_reporting",
- FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
- FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
- FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
- nullptr, chttp2_create_fixture_load_reporting,
- chttp2_init_client_load_reporting, chttp2_init_server_load_reporting,
- chttp2_tear_down_load_reporting},
-};
-
-int main(int argc, char** argv) {
- size_t i;
-
- grpc_test_init(argc, argv);
- grpc_end2end_tests_pre_init();
- grpc_init();
-
- for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
- grpc_end2end_tests(argc, argv, configs[i]);
- }
-
- grpc_shutdown();
-
- return 0;
-}
diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py
index 04dc2a8785..d5c23262e3 100755
--- a/test/core/end2end/gen_build_yaml.py
+++ b/test/core/end2end/gen_build_yaml.py
@@ -47,7 +47,9 @@ inproc_fixture_options = default_unsecure_fixture_options._replace(
END2END_FIXTURES = {
'h2_compress': default_unsecure_fixture_options._replace(enables_compression=True),
'h2_census': default_unsecure_fixture_options,
- 'h2_load_reporting': default_unsecure_fixture_options,
+ # This cmake target is disabled for now because it depends on OpenCensus,
+ # which is Bazel-only.
+ # 'h2_load_reporting': default_unsecure_fixture_options,
'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False),
'h2_fd': fd_unsecure_fixture_options,
'h2_full': default_unsecure_fixture_options,
@@ -143,7 +145,9 @@ END2END_TESTS = {
'no_logging': default_test_options._replace(traceable=False),
'no_op': default_test_options,
'payload': default_test_options,
- 'load_reporting_hook': default_test_options,
+ # This cmake target is disabled for now because it depends on OpenCensus,
+ # which is Bazel-only.
+ # 'load_reporting_hook': default_test_options,
'ping_pong_streaming': default_test_options._replace(cpu_cost=LOWCPU),
'ping': connectivity_test_options._replace(proxyable=False,
cpu_cost=LOWCPU),
diff --git a/test/core/end2end/generate_tests.bzl b/test/core/end2end/generate_tests.bzl
index 67769a8cb1..39b11d08ad 100755
--- a/test/core/end2end/generate_tests.bzl
+++ b/test/core/end2end/generate_tests.bzl
@@ -45,7 +45,9 @@ def fixture_options(fullstack=True, includes_proxy=False, dns_resolver=True,
END2END_FIXTURES = {
'h2_compress': fixture_options(),
'h2_census': fixture_options(),
- 'h2_load_reporting': fixture_options(),
+ # TODO(juanlishen): This is disabled for now, but should be considered to re-enable once we have
+ # decided how the load reporting service should be enabled.
+ #'h2_load_reporting': fixture_options(),
'h2_fakesec': fixture_options(),
'h2_fd': fixture_options(dns_resolver=False, fullstack=False,
client_channel=False,
@@ -139,7 +141,10 @@ END2END_TESTS = {
'no_logging': test_options(traceable=False),
'no_op': test_options(),
'payload': test_options(),
- 'load_reporting_hook': test_options(),
+ # TODO(juanlishen): This is disabled for now because it depends on some generated functions in
+ # end2end_tests.cc, which are not generated because they would depend on OpenCensus while
+ # OpenCensus can only be built via Bazel so far.
+ # 'load_reporting_hook': test_options(),
'ping_pong_streaming': test_options(),
'ping': test_options(needs_fullstack=True, proxyable=False),
'proxy_auth': test_options(needs_proxy_auth=True),
diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c
index 29083061bb..bad28fef5b 100644
--- a/test/core/surface/public_headers_must_be_c89.c
+++ b/test/core/surface/public_headers_must_be_c89.c
@@ -40,7 +40,6 @@
#include <grpc/impl/codegen/sync.h>
#include <grpc/impl/codegen/sync_custom.h>
#include <grpc/impl/codegen/sync_generic.h>
-#include <grpc/load_reporting.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/status.h>
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc
index dd1610dc3d..9516b2e3e2 100644
--- a/test/cpp/microbenchmarks/bm_call_create.cc
+++ b/test/cpp/microbenchmarks/bm_call_create.cc
@@ -604,10 +604,13 @@ BENCHMARK_TEMPLATE(BM_IsolatedFilter, HttpServerFilter, SendEmptyMetadata);
typedef Fixture<&grpc_message_size_filter, CHECKS_NOT_LAST> MessageSizeFilter;
BENCHMARK_TEMPLATE(BM_IsolatedFilter, MessageSizeFilter, NoOp);
BENCHMARK_TEMPLATE(BM_IsolatedFilter, MessageSizeFilter, SendEmptyMetadata);
-typedef Fixture<&grpc_server_load_reporting_filter, CHECKS_NOT_LAST>
- LoadReportingFilter;
-BENCHMARK_TEMPLATE(BM_IsolatedFilter, LoadReportingFilter, NoOp);
-BENCHMARK_TEMPLATE(BM_IsolatedFilter, LoadReportingFilter, SendEmptyMetadata);
+// This cmake target is disabled for now because it depends on OpenCensus, which
+// is Bazel-only.
+// typedef Fixture<&grpc_server_load_reporting_filter, CHECKS_NOT_LAST>
+// LoadReportingFilter;
+// BENCHMARK_TEMPLATE(BM_IsolatedFilter, LoadReportingFilter, NoOp);
+// BENCHMARK_TEMPLATE(BM_IsolatedFilter, LoadReportingFilter,
+// SendEmptyMetadata);
////////////////////////////////////////////////////////////////////////////////
// Benchmarks isolating grpc_call