Enable xds retry test for cpp (#26828)

* enable retry

* enable cpp

* fix cpp format

* fix indent
pull/26837/head
ZHANG Dapeng 4 years ago committed by GitHub
parent c9149526a6
commit ca482bdbc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      test/cpp/interop/xds_interop_client.cc
  2. 10
      tools/run_tests/xds_k8s_test_driver/tests/url_map/retry_test.py

@ -465,12 +465,15 @@ class XdsUpdateClientConfigureServiceImpl
void RunTestLoop(std::chrono::duration<double> duration_per_query, void RunTestLoop(std::chrono::duration<double> duration_per_query,
StatsWatchers* stats_watchers, StatsWatchers* stats_watchers,
RpcConfigurationsQueue* rpc_configs_queue) { RpcConfigurationsQueue* rpc_configs_queue) {
grpc::ChannelArguments channel_args;
channel_args.SetInt(GRPC_ARG_ENABLE_RETRIES, 1);
TestClient client( TestClient client(
grpc::CreateChannel(absl::GetFlag(FLAGS_server), grpc::CreateCustomChannel(absl::GetFlag(FLAGS_server),
absl::GetFlag(FLAGS_secure_mode) absl::GetFlag(FLAGS_secure_mode)
? grpc::experimental::XdsCredentials( ? grpc::experimental::XdsCredentials(
grpc::InsecureChannelCredentials()) grpc::InsecureChannelCredentials())
: grpc::InsecureChannelCredentials()), : grpc::InsecureChannelCredentials(),
channel_args),
stats_watchers); stats_watchers);
std::chrono::time_point<std::chrono::system_clock> start = std::chrono::time_point<std::chrono::system_clock> start =
std::chrono::system_clock::now(); std::chrono::system_clock::now();

@ -63,8 +63,9 @@ def _build_retry_route_rule(retryConditions, num_retries):
} }
@absltest.skipUnless('java-client' in xds_k8s_flags.CLIENT_IMAGE.value, @absltest.skipUnless('cpp-client' in xds_k8s_flags.CLIENT_IMAGE.value or \
'Retry is currently only implemented in Java.') 'java-client' in xds_k8s_flags.CLIENT_IMAGE.value,
'Xds-retry is currently only implemented in C++ and Java.')
class TestRetryUpTo3AttemptsAndFail(xds_url_map_testcase.XdsUrlMapTestCase): class TestRetryUpTo3AttemptsAndFail(xds_url_map_testcase.XdsUrlMapTestCase):
@staticmethod @staticmethod
@ -100,8 +101,9 @@ class TestRetryUpTo3AttemptsAndFail(xds_url_map_testcase.XdsUrlMapTestCase):
tolerance=_NON_RANDOM_ERROR_TOLERANCE) tolerance=_NON_RANDOM_ERROR_TOLERANCE)
@absltest.skipUnless('java-client' in xds_k8s_flags.CLIENT_IMAGE.value, @absltest.skipUnless('cpp-client' in xds_k8s_flags.CLIENT_IMAGE.value or \
'Retry is currently only implemented in Java.') 'java-client' in xds_k8s_flags.CLIENT_IMAGE.value,
'Xds-retry is currently only implemented in C++ Java.')
class TestRetryUpTo4AttemptsAndSucceed(xds_url_map_testcase.XdsUrlMapTestCase): class TestRetryUpTo4AttemptsAndSucceed(xds_url_map_testcase.XdsUrlMapTestCase):
@staticmethod @staticmethod

Loading…
Cancel
Save