From 51d710273fcfe04f414446ee6eaf8f6d25d4d021 Mon Sep 17 00:00:00 2001
From: kpayson64 <kpayson@google.com>
Date: Mon, 2 Apr 2018 11:10:31 -0700
Subject: [PATCH] Fix gevent test flakes

---
 src/python/grpcio_tests/commands.py                            | 2 ++
 .../grpcio_tests/tests/interop/_insecure_intraop_test.py       | 3 +++
 src/python/grpcio_tests/tests/interop/_secure_intraop_test.py  | 3 +++
 3 files changed, 8 insertions(+)

diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py
index d4dbcdc191c..42e01c18d3e 100644
--- a/src/python/grpcio_tests/commands.py
+++ b/src/python/grpcio_tests/commands.py
@@ -121,6 +121,8 @@ class TestGevent(setuptools.Command):
         'testing._client_test.ClientTest.test_infinite_request_stream_real_time',
         # TODO(https://github.com/grpc/grpc/issues/14789) enable this test
         'unit._server_ssl_cert_config_test',
+        # TODO(https://github.com/grpc/grpc/issues/14901) enable this test
+        'protoc_plugin._python_plugin_test.PythonPluginTest',
         # Beta API is unsupported for gevent
         'protoc_plugin.beta_python_plugin_test',
         'unit.beta._beta_features_test',
diff --git a/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py b/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py
index 8d464b2d4b5..ace15bea585 100644
--- a/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py
+++ b/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py
@@ -36,6 +36,9 @@ class InsecureIntraopTest(_intraop_test_case.IntraopTestCase,
         self.stub = test_pb2_grpc.TestServiceStub(
             grpc.insecure_channel('localhost:{}'.format(port)))
 
+    def tearDown(self):
+        self.server.stop(None)
+
 
 if __name__ == '__main__':
     unittest.main(verbosity=2)
diff --git a/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py b/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
index c89135998dc..e27e551ecb0 100644
--- a/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
+++ b/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
@@ -45,6 +45,9 @@ class SecureIntraopTest(_intraop_test_case.IntraopTestCase, unittest.TestCase):
                                         _SERVER_HOST_OVERRIDE,
                                     ),)))
 
+    def tearDown(self):
+        self.server.stop(None)
+
 
 if __name__ == '__main__':
     unittest.main(verbosity=2)