request = health_pb2.HealthCheckRequest(service='')
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(
- target=_consume_responses, args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(
- target=_consume_responses, args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(
- target=_consume_responses, args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
response_queue2 = queue.Queue()
rendezvous1 = self._stub.Watch(request)
rendezvous2 = self._stub.Watch(request)
- thread1 = threading.Thread(
- target=_consume_responses, args=(rendezvous1, response_queue1))
- thread2 = threading.Thread(
- target=_consume_responses, args=(rendezvous2, response_queue2))
+ thread1 = threading.Thread(target=_consume_responses,
+ args=(rendezvous1, response_queue1))
+ thread2 = threading.Thread(target=_consume_responses,
+ args=(rendezvous2, response_queue2))
thread1.start()
thread2.start()
request = health_pb2.HealthCheckRequest(service=_WATCH_SERVICE)
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(
- target=_consume_responses, args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
# Wait, if necessary, for serving thread to process client cancellation
timeout = time.time() + test_constants.TIME_ALLOWANCE
- while time.time(
- ) < timeout and self._servicer._send_response_callbacks[_WATCH_SERVICE]:
+ while (time.time() < timeout and
+ self._servicer._send_response_callbacks[_WATCH_SERVICE]):
time.sleep(1)
self.assertFalse(
self._servicer._send_response_callbacks[_WATCH_SERVICE],
request = health_pb2.HealthCheckRequest(service='')
response_queue = queue.Queue()
rendezvous = self._stub.Watch(request)
- thread = threading.Thread(
- target=_consume_responses, args=(rendezvous, response_queue))
+ thread = threading.Thread(target=_consume_responses,
+ args=(rendezvous, response_queue))
thread.start()
response = response_queue.get(timeout=test_constants.SHORT_TIMEOUT)
def setUp(self):
self._thread_pool = thread_pool.RecordingThreadPool(max_workers=None)
- super(HealthServicerTest, self).start_server(
- non_blocking=True, thread_pool=self._thread_pool)
+ super(HealthServicerTest,
+ self).start_server(non_blocking=True,
+ thread_pool=self._thread_pool)
def test_check_empty_service(self):
request = health_pb2.HealthCheckRequest()
class HealthServicerBackwardsCompatibleWatchTest(BaseWatchTests.WatchTests):
def setUp(self):
- super(HealthServicerBackwardsCompatibleWatchTest, self).start_server(
- non_blocking=False, thread_pool=None)
+ super(HealthServicerBackwardsCompatibleWatchTest,
+ self).start_server(non_blocking=False, thread_pool=None)
if __name__ == '__main__':