Address review comments; fix sanity

pull/19623/head
Alexander Polcyn 5 years ago
parent 4999420c7d
commit 3958a53bf7
  1. 4
      CMakeLists.txt
  2. 2
      build.yaml
  3. 26
      test/cpp/interop/grpclb_fallback_test.cc
  4. 10
      tools/run_tests/generated/tests.json

@ -638,7 +638,9 @@ add_dependencies(buildtests_cxx grpc_linux_system_roots_test)
add_dependencies(buildtests_cxx grpc_tool_test)
add_dependencies(buildtests_cxx grpclb_api_test)
add_dependencies(buildtests_cxx grpclb_end2end_test)
if(_gRPC_PLATFORM_LINUX)
add_dependencies(buildtests_cxx grpclb_fallback_test)
endif()
add_dependencies(buildtests_cxx h2_ssl_cert_test)
add_dependencies(buildtests_cxx h2_ssl_session_reuse_test)
add_dependencies(buildtests_cxx health_service_end2end_test)
@ -14468,6 +14470,7 @@ target_link_libraries(grpclb_end2end_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX)
add_executable(grpclb_fallback_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.pb.cc
@ -14528,6 +14531,7 @@ target_link_libraries(grpclb_fallback_test
)
endif()
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)

@ -5056,6 +5056,8 @@ targets:
- grpc
- gpr
- grpc++_test_config
platforms:
- linux
- name: h2_ssl_cert_test
gtest: true
build: test

@ -1,3 +1,21 @@
/*
*
* Copyright 2019 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 <grpc/support/port_platform.h>
#include <arpa/inet.h>
@ -111,7 +129,7 @@ bool TcpUserTimeoutMutateFd(int fd, grpc_socket_mutator* mutator) {
socklen_t len = sizeof(newval);
if (0 != getsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &newval, &len) ||
newval != timeout) {
gpr_log(GPR_ERROR, "Failed to set socket option TCP_USER_TIMEOUT");
gpr_log(GPR_ERROR, "Failed to get expected socket option TCP_USER_TIMEOUT");
abort();
}
return true;
@ -147,7 +165,7 @@ std::unique_ptr<TestService::Stub> CreateFallbackTestStub() {
grpc::CreateCustomChannel(FLAGS_server_uri, channel_creds, channel_args));
}
void RunCommand(const std::string command) {
void RunCommand(const std::string& command) {
gpr_log(GPR_INFO, "RunCommand: |%s|", command.c_str());
int out = std::system(command.c_str());
if (WIFEXITED(out)) {
@ -164,7 +182,7 @@ void RunCommand(const std::string command) {
}
void RunFallbackBeforeStartupTest(
const std::string break_lb_and_backend_conns_cmd,
const std::string& break_lb_and_backend_conns_cmd,
int per_rpc_deadline_seconds) {
std::unique_ptr<TestService::Stub> stub = CreateFallbackTestStub();
RunCommand(break_lb_and_backend_conns_cmd);
@ -189,7 +207,7 @@ void DoSlowFallbackBeforeStartup() {
}
void RunFallbackAfterStartupTest(
const std::string break_lb_and_backend_conns_cmd) {
const std::string& break_lb_and_backend_conns_cmd) {
std::unique_ptr<TestService::Stub> stub = CreateFallbackTestStub();
GrpclbRouteType grpclb_route_type = DoRPCAndGetPath(stub.get(), 20);
if (grpclb_route_type != GrpclbRouteType::GRPCLB_ROUTE_TYPE_BACKEND) {

@ -4817,10 +4817,7 @@
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
"linux"
],
"cpu_cost": 1.0,
"exclude_configs": [],
@ -4830,10 +4827,7 @@
"language": "c++",
"name": "grpclb_fallback_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
"linux"
],
"uses_polling": true
},

Loading…
Cancel
Save