Merge pull request #4362 from vjpai/coverage-serve2

Cover an unsupported case of mixing sync and async service in server
pull/4370/head
Yang Gao 9 years ago
commit 5b763f5355
  1. 11
      test/cpp/end2end/async_end2end_test.cc

@ -179,6 +179,17 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<bool> {
void SetUp() GRPC_OVERRIDE {
int port = grpc_pick_unused_port_or_die();
server_address_ << "localhost:" << port;
// It is currently unsupported to mix sync and async services
// in the same server, so first test that (for coverage)
ServerBuilder build_bad;
build_bad.AddListeningPort(server_address_.str(),
grpc::InsecureServerCredentials());
build_bad.RegisterAsyncService(&service_);
grpc::cpp::test::util::TestService::Service sync_service;
build_bad.RegisterService(&sync_service);
GPR_ASSERT(build_bad.BuildAndStart() == nullptr);
// Setup server
ServerBuilder builder;
builder.AddListeningPort(server_address_.str(),

Loading…
Cancel
Save