diff options
author | 2018-02-06 16:07:32 -0800 | |
---|---|---|
committer | 2018-02-06 16:07:32 -0800 | |
commit | b66e6fe76122265f8d5eabf0a1200ff91b95e253 (patch) | |
tree | c07d2ffdf819a4a9a8e4c02df3795af74409af91 /src/python/grpcio_tests/tests | |
parent | b7bf76851d7a0f022ddfd0ceb00174dc04a095c6 (diff) |
Sleep a second to deflake ReconnectTest
The thread that watches connectivity on the channel might not
pick up that the server has gone away before the request is
dispatched, and return UNAVAILABLE instead of reconnecting
prior to sending the request. The fundamental solution would
basically be enabling retries in C-core. For now, we opt to
sleep a second to deflake this particular test case.
Diffstat (limited to 'src/python/grpcio_tests/tests')
-rw-r--r-- | src/python/grpcio_tests/tests/unit/_reconnect_test.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/python/grpcio_tests/tests/unit/_reconnect_test.py b/src/python/grpcio_tests/tests/unit/_reconnect_test.py index 10aee9fb4f..8acba5a30b 100644 --- a/src/python/grpcio_tests/tests/unit/_reconnect_test.py +++ b/src/python/grpcio_tests/tests/unit/_reconnect_test.py @@ -14,6 +14,7 @@ """Tests that a channel will reconnect if a connection is dropped""" import socket +import time import unittest import grpc @@ -88,6 +89,7 @@ class ReconnectTest(unittest.TestCase): multi_callable = channel.unary_unary(_UNARY_UNARY) self.assertEqual(_RESPONSE, multi_callable(_REQUEST)) server.stop(None) + time.sleep(1) server = grpc.server(server_pool, (handler,)) server.add_insecure_port('[::]:{}'.format(port)) server.start() |