From db213384b4fdcd6c35529f8f2e875bd1e404fd72 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Thu, 14 Dec 2023 12:30:29 -0800 Subject: [PATCH] Address pylint and clarify logging --- .../framework/test_app/client_app.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py b/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py index ad4c7b9e9da..5da8a088908 100644 --- a/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py +++ b/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py @@ -282,7 +282,7 @@ class XdsTestClient(framework.rpc.grpc.GrpcApp): ) logger.info( - "[%s] ADS: Waiting for successful calls to xDS control plane to %s", + "[%s] ADS: Waiting for active calls to xDS control plane to %s", self.hostname, xds_server_uri, ) @@ -292,7 +292,7 @@ class XdsTestClient(framework.rpc.grpc.GrpcApp): rpc_deadline=rpc_deadline, ) logger.info( - "[%s] ADS: Detected successful calls to xDS control plane %s", + "[%s] ADS: Detected active calls to xDS control plane %s", self.hostname, xds_server_uri, ) @@ -320,11 +320,11 @@ class XdsTestClient(framework.rpc.grpc.GrpcApp): channel, **rpc_params ) logger.info( - "[%s] Detected successful calls to xDS control plane %s," + "[%s] Detected active calls to xDS control plane %s," " channel: %s", self.hostname, xds_server_uri, - _ChannelzServiceClient.channel_repr(channel), + _ChannelzServiceClient.channel_repr(channel_upd), ) return channel_upd except self.NotFound: @@ -332,9 +332,15 @@ class XdsTestClient(framework.rpc.grpc.GrpcApp): # not found. continue except framework.rpc.grpc.RpcError as err: - logger.debug( - f"Unexpected error while checking" - f" channel {channel.ref.channel_id}: {err}" + # Logged at 'info' and not at 'warning' because this method is + # expected to be called in a retryer. If this error eventually + # causes the retryer to fail, it will be logged fully at 'error' + logger.info( + "[%s] Unexpected error while checking xDS control plane" + " channel %s: %r", + self.hostname, + _ChannelzServiceClient.channel_repr(channel), + err, ) raise