pull/17597/head
Eric Gribkoff 6 years ago
parent e678187996
commit 4e3e46df22
  1. 1
      src/python/grpcio_tests/tests/health_check/BUILD.bazel
  2. 6
      src/python/grpcio_tests/tests/health_check/_health_servicer_test.py

@ -9,6 +9,7 @@ py_test(
"//src/python/grpcio/grpc:grpcio",
"//src/python/grpcio_health_checking/grpc_health/v1:grpc_health",
"//src/python/grpcio_tests/tests/unit:test_common",
"//src/python/grpcio_tests/tests/unit/framework/common:common",
],
imports = ["../../",],
)

@ -14,6 +14,7 @@
"""Tests of grpc_health.v1.health."""
import threading
import time
import unittest
import grpc
@ -206,6 +207,11 @@ class HealthServicerTest(unittest.TestCase):
self._servicer.set(_WATCH_SERVICE,
health_pb2.HealthCheckResponse.SERVING)
thread.join()
# Wait, if necessary, for serving thread to process client cancellation
timeout = time.time() + test_constants.SHORT_TIMEOUT
while time.time() < timeout and self._servicer._watchers[_WATCH_SERVICE]:
time.sleep(1)
self.assertFalse(self._servicer._watchers[_WATCH_SERVICE],
'watch set should be empty')
self.assertTrue(response_queue.empty())

Loading…
Cancel
Save