Skip to content
Snippets Groups Projects
Commit 5b763f53 authored by Yang Gao's avatar Yang Gao
Browse files

Merge pull request #4362 from vjpai/coverage-serve2

Cover an unsupported case of mixing sync and async service in server
parents 141272d5 017ed62c
No related branches found
No related tags found
No related merge requests found
......@@ -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(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment