Skip to content
Snippets Groups Projects
Commit 017ed62c authored by vjpai's avatar vjpai
Browse files

Cover an unsupported case of mixing sync and async service in same server

parent eec13dc4
No related branches found
No related tags found
No related merge requests found
...@@ -179,6 +179,17 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<bool> { ...@@ -179,6 +179,17 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<bool> {
void SetUp() GRPC_OVERRIDE { void SetUp() GRPC_OVERRIDE {
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
server_address_ << "localhost:" << port; 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 // Setup server
ServerBuilder builder; ServerBuilder builder;
builder.AddListeningPort(server_address_.str(), 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