From 017ed62ce4ba277ae3e68ffd41a5a1ee80fb82bf Mon Sep 17 00:00:00 2001
From: vjpai <vpai@google.com>
Date: Wed, 9 Dec 2015 10:42:54 -0800
Subject: [PATCH] Cover an unsupported case of mixing sync and async service in
 same server

---
 test/cpp/end2end/async_end2end_test.cc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 74290c36d2..364aa417cd 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/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(),
-- 
GitLab