Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(test): fix grpc gentle shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Aug 2, 2019
1 parent f92dad5 commit c5c811d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gnes/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class ColoredFormatter(Formatter):
'WARNING': dict(color='red', on_color='on_yellow'), # yellow
'ERROR': dict(color='white', on_color='on_red'), # 31 for red
'CRITICAL': dict(color='red', on_color='on_white'), # white on red bg
'SUCCESS': dict(color='white', on_color='on_green'), # green
}

PREFIX = '\033['
Expand Down Expand Up @@ -535,4 +536,3 @@ def load_contrib_module():
profiling = time_profile

yaml = _get_yaml()

2 changes: 1 addition & 1 deletion gnes/service/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _run(self, ctx):
self.is_ready.set()
self.is_event_loop.set()
self._start_auto_dump()
self.logger.info('ready and listening')
self.logger.info(colored('ready and listening', color='white', on_color='on_green'))
while self.is_event_loop.is_set():
pull_sock = None
socks = dict(poller.poll())
Expand Down
2 changes: 1 addition & 1 deletion gnes/service/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ def __enter__(self):
return self

def __exit__(self, exc_type, exc_val, exc_tb):
self.server.stop()
self.server.stop(None)
2 changes: 1 addition & 1 deletion tests/test_stream_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_async_block(self):
'--socket_out', str(SocketType.PUSH_CONNECT),
])

with Router1(p1_args), Router2(p2_args), GRPCFrontend(args), grpc.insecure_channel(
with GRPCFrontend(args), Router1(p1_args), Router2(p2_args), grpc.insecure_channel(
'%s:%s' % (args.grpc_host, args.grpc_port),
options=[('grpc.max_send_message_length', 70 * 1024 * 1024),
('grpc.max_receive_message_length', 70 * 1024 * 1024)]) as channel:
Expand Down

0 comments on commit c5c811d

Please sign in to comment.