aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_tests
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2016-12-13 12:51:14 -0800
committerGravatar GitHub <noreply@github.com>2016-12-13 12:51:14 -0800
commit665ec81e9ceea6359167d1354eba589249ea186f (patch)
tree555d8cb059a6b728be4f6b6c87998c16debd8d8e /src/python/grpcio_tests
parent343395b005c515d3b7ca3b28159d997b1d90921e (diff)
parent83decd64e066d488ca604d67a4e759c26cb0b0fa (diff)
Merge pull request #9006 from kpayson64/revert_bizarre_api
Revert "Add configurable exit grace periods and shutdown handlers"
Diffstat (limited to 'src/python/grpcio_tests')
-rw-r--r--src/python/grpcio_tests/tests/tests.json1
-rw-r--r--src/python/grpcio_tests/tests/unit/_exit_test.py23
2 files changed, 1 insertions, 23 deletions
diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json
index 04a2e44178..dd4a0257f5 100644
--- a/src/python/grpcio_tests/tests/tests.json
+++ b/src/python/grpcio_tests/tests/tests.json
@@ -27,7 +27,6 @@
"unit._cython.cygrpc_test.TypeSmokeTest",
"unit._empty_message_test.EmptyMessageTest",
"unit._exit_test.ExitTest",
- "unit._exit_test.ShutdownHandlerTest",
"unit._metadata_code_details_test.MetadataCodeDetailsTest",
"unit._metadata_test.MetadataTest",
"unit._rpc_test.RPCTest",
diff --git a/src/python/grpcio_tests/tests/unit/_exit_test.py b/src/python/grpcio_tests/tests/unit/_exit_test.py
index 342f5fcc10..5a4a32887c 100644
--- a/src/python/grpcio_tests/tests/unit/_exit_test.py
+++ b/src/python/grpcio_tests/tests/unit/_exit_test.py
@@ -43,8 +43,6 @@ import threading
import time
import unittest
-import grpc
-from grpc.framework.foundation import logging_pool
from tests.unit import _exit_scenarios
SCENARIO_FILE = os.path.abspath(os.path.join(
@@ -54,7 +52,7 @@ BASE_COMMAND = [INTERPRETER, SCENARIO_FILE]
BASE_SIGTERM_COMMAND = BASE_COMMAND + ['--wait_for_interrupt']
INIT_TIME = 1.0
-SHUTDOWN_GRACE = 5.0
+
processes = []
process_lock = threading.Lock()
@@ -184,24 +182,5 @@ class ExitTest(unittest.TestCase):
interrupt_and_wait(process)
-class _ShutDownHandler(object):
-
- def __init__(self):
- self.seen_handler_grace = None
-
- def shutdown_handler(self, handler_grace):
- self.seen_handler_grace = handler_grace
-
-
-class ShutdownHandlerTest(unittest.TestCase):
-
- def test_shutdown_handler(self):
- server = grpc.server(logging_pool.pool(1))
- handler = _ShutDownHandler()
- server.add_shutdown_handler(handler.shutdown_handler)
- server.start()
- server.stop(0, shutdown_handler_grace=SHUTDOWN_GRACE).wait()
- self.assertEqual(SHUTDOWN_GRACE, handler.seen_handler_grace)
-
if __name__ == '__main__':
unittest.main(verbosity=2)