aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-10-04 16:34:40 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-10-04 16:34:40 -0700
commitd7c8c2bf947d620f257a00e1ce5c37aab3d50951 (patch)
treec20654f4920263bdacadf21dc65f273a08989b68 /test/cpp
parenta4aebf873e485a39084bb003c6978b3306874bf7 (diff)
parent49480d4cf2c8c95825a6bd37172e96bebb39dc69 (diff)
Merge remote-tracking branch 'upstream/master' into proto_db
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/grpclb/grpclb_test.cc8
-rwxr-xr-xtest/cpp/qps/gen_build_yaml.py5
-rw-r--r--test/cpp/util/byte_buffer_proto_helper.cc2
-rw-r--r--test/cpp/util/byte_buffer_test.cc2
-rw-r--r--test/cpp/util/cli_call.cc2
-rw-r--r--test/cpp/util/proto_file_parser.cc15
6 files changed, 22 insertions, 12 deletions
diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc
index 95abe38031..7666c4e60b 100644
--- a/test/cpp/grpclb/grpclb_test.cc
+++ b/test/cpp/grpclb/grpclb_test.cc
@@ -59,6 +59,7 @@ extern "C" {
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h"
#include "test/core/end2end/cq_verifier.h"
+#include "test/core/end2end/fake_resolver.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
}
@@ -214,7 +215,7 @@ static void start_lb_server(server_fixture *sf, int *ports, size_t nports,
request.ParseFromArray(GPR_SLICE_START_PTR(request_payload_slice),
GPR_SLICE_LENGTH(request_payload_slice));
GPR_ASSERT(request.has_initial_request());
- GPR_ASSERT(request.initial_request().name() == "load.balanced.service.name");
+ GPR_ASSERT(request.initial_request().name() == sf->servers_hostport);
gpr_slice_unref(request_payload_slice);
grpc_byte_buffer_reader_destroy(&bbr);
grpc_byte_buffer_destroy(request_payload_recv);
@@ -460,7 +461,7 @@ static void perform_request(client_fixture *cf) {
c = grpc_channel_create_call(cf->client, NULL, GRPC_PROPAGATE_DEFAULTS,
cf->cq, "/foo", "foo.test.google.fr:1234",
- GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1000), NULL);
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL);
gpr_log(GPR_INFO, "Call 0x%" PRIxPTR " created", (intptr_t)c);
GPR_ASSERT(c);
char *peer;
@@ -633,7 +634,7 @@ static test_fixture setup_test_fixture(int lb_server_update_delay_ms) {
gpr_thd_new(&tf.lb_server.tid, fork_lb_server, &tf.lb_server, &options);
char *server_uri;
- gpr_asprintf(&server_uri, "ipv4:%s?lb_policy=grpclb&lb_enabled=1",
+ gpr_asprintf(&server_uri, "test:%s?lb_policy=grpclb&lb_enabled=1",
tf.lb_server.servers_hostport);
setup_client(server_uri, &tf.client);
gpr_free(server_uri);
@@ -716,6 +717,7 @@ TEST(GrpclbTest, InvalidAddressInServerlist) {}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
grpc_test_init(argc, argv);
+ grpc_fake_resolver_init();
grpc_init();
const auto result = RUN_ALL_TESTS();
grpc_shutdown();
diff --git a/test/cpp/qps/gen_build_yaml.py b/test/cpp/qps/gen_build_yaml.py
index 4ff4e44b8b..369da2c8ca 100755
--- a/test/cpp/qps/gen_build_yaml.py
+++ b/test/cpp/qps/gen_build_yaml.py
@@ -74,8 +74,8 @@ print yaml.dump({
'name': 'json_run_localhost',
'shortname': 'json_run_localhost:%s' % scenario_json['name'],
'args': ['--scenarios_json', _scenario_json_string(scenario_json)],
- 'ci_platforms': ['linux', 'mac', 'posix', 'windows'],
- 'platforms': ['linux', 'mac', 'posix', 'windows'],
+ 'ci_platforms': ['linux'],
+ 'platforms': ['linux'],
'flaky': False,
'language': 'c++',
'boringssl': True,
@@ -85,5 +85,6 @@ print yaml.dump({
'timeout_seconds': 3*60
}
for scenario_json in scenario_config.CXXLanguage().scenarios()
+ if 'scalable' in scenario_json.get('CATEGORIES', [])
]
})
diff --git a/test/cpp/util/byte_buffer_proto_helper.cc b/test/cpp/util/byte_buffer_proto_helper.cc
index 2512c9bdf8..d625d6f3f4 100644
--- a/test/cpp/util/byte_buffer_proto_helper.cc
+++ b/test/cpp/util/byte_buffer_proto_helper.cc
@@ -38,7 +38,7 @@ namespace testing {
bool ParseFromByteBuffer(ByteBuffer* buffer, grpc::protobuf::Message* message) {
std::vector<Slice> slices;
- buffer->Dump(&slices);
+ (void)buffer->Dump(&slices);
grpc::string buf;
buf.reserve(buffer->Length());
for (auto s = slices.begin(); s != slices.end(); s++) {
diff --git a/test/cpp/util/byte_buffer_test.cc b/test/cpp/util/byte_buffer_test.cc
index 1167c790d4..2089a62011 100644
--- a/test/cpp/util/byte_buffer_test.cc
+++ b/test/cpp/util/byte_buffer_test.cc
@@ -100,7 +100,7 @@ TEST_F(ByteBufferTest, Dump) {
slices.push_back(Slice(world, Slice::STEAL_REF));
ByteBuffer buffer(&slices[0], 2);
slices.clear();
- buffer.Dump(&slices);
+ (void)buffer.Dump(&slices);
EXPECT_TRUE(SliceEqual(slices[0], hello));
EXPECT_TRUE(SliceEqual(slices[1], world));
}
diff --git a/test/cpp/util/cli_call.cc b/test/cpp/util/cli_call.cc
index 98b9d930d6..1edffbe08e 100644
--- a/test/cpp/util/cli_call.cc
+++ b/test/cpp/util/cli_call.cc
@@ -94,7 +94,7 @@ Status CliCall::Call(std::shared_ptr<grpc::Channel> channel,
if (status.ok()) {
std::vector<grpc::Slice> slices;
- recv_buffer.Dump(&slices);
+ (void)recv_buffer.Dump(&slices);
response->clear();
for (size_t i = 0; i < slices.size(); i++) {
diff --git a/test/cpp/util/proto_file_parser.cc b/test/cpp/util/proto_file_parser.cc
index 0c88c24448..01acb01532 100644
--- a/test/cpp/util/proto_file_parser.cc
+++ b/test/cpp/util/proto_file_parser.cc
@@ -36,6 +36,7 @@
#include <algorithm>
#include <iostream>
#include <sstream>
+#include <unordered_set>
#include <grpc++/support/config.h>
@@ -87,6 +88,7 @@ ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
reflection_db_->GetServices(&service_list);
}
+ std::unordered_set<grpc::string> known_services;
if (!protofiles.empty()) {
source_tree_.MapPath("", proto_path);
error_printer_.reset(new ErrorPrinter(this));
@@ -100,6 +102,7 @@ ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
if (file_desc) {
for (int i = 0; i < file_desc->service_count(); i++) {
service_desc_list_.push_back(file_desc->service(i));
+ known_services.insert(file_desc->service(i)->full_name());
}
} else {
std::cerr << file_name << " not found" << std::endl;
@@ -127,9 +130,12 @@ ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
dynamic_factory_.reset(new protobuf::DynamicMessageFactory(desc_pool_.get()));
for (auto it = service_list.begin(); it != service_list.end(); it++) {
- if (const protobuf::ServiceDescriptor* service_desc =
- desc_pool_->FindServiceByName(*it)) {
- service_desc_list_.push_back(service_desc);
+ if (known_services.find(*it) == known_services.end()) {
+ if (const protobuf::ServiceDescriptor* service_desc =
+ desc_pool_->FindServiceByName(*it)) {
+ service_desc_list_.push_back(service_desc);
+ known_services.insert(*it);
+ }
}
}
}
@@ -146,7 +152,8 @@ grpc::string ProtoFileParser::GetFullMethodName(const grpc::string& method) {
const auto* method_desc = service_desc->method(j);
if (MethodNameMatch(method_desc->full_name(), method)) {
if (method_descriptor) {
- std::ostringstream error_stream("Ambiguous method names: ");
+ std::ostringstream error_stream;
+ error_stream << "Ambiguous method names: ";
error_stream << method_descriptor->full_name() << " ";
error_stream << method_desc->full_name();
LogError(error_stream.str());