Merge pull request #23891 from menghanl/v1.31.x

xds testing: add a test case with multiple routes referring to same cluster
pull/23942/head
Menghan Li 4 years ago committed by GitHub
commit c43543050e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 36
      tools/run_tests/run_xds_tests.py

@ -828,12 +828,40 @@ def test_path_matching(gcp, original_backend_service, instance_group,
{
"UnaryCall": alternate_backend_instances,
"EmptyCall": original_backend_instances
}),
(
# This test case is similar to the one above (but with route
# services swapped). This test has two routes (full_path and
# the default) to match EmptyCall, and both routes set
# alternative_backend_service as the action. This forces the
# client to handle duplicate Clusters in the RDS response.
[
{
'priority': 0,
# Prefix UnaryCall -> original_backend_service.
'matchRules': [{
'prefixMatch': '/grpc.testing.TestService/Unary'
}],
'service': original_backend_service.url
},
{
'priority': 1,
# FullPath EmptyCall -> alternate_backend_service.
'matchRules': [{
'fullPathMatch':
'/grpc.testing.TestService/EmptyCall'
}],
'service': alternate_backend_service.url
}
],
{
"UnaryCall": original_backend_instances,
"EmptyCall": alternate_backend_instances
})
]
for (route_rules, expected_instances) in test_cases:
logger.info('patching url map with %s -> alternative',
route_rules[0]['matchRules'])
logger.info('patching url map with %s', route_rules)
patch_url_map_backend_service(gcp,
original_backend_service,
route_rules=route_rules)
@ -846,8 +874,8 @@ def test_path_matching(gcp, original_backend_service, instance_group,
original_backend_instances + alternate_backend_instances,
_WAIT_FOR_STATS_SEC)
retry_count = 10
# Each attempt takes about 10 seconds, 10 retries is equivalent to 100
retry_count = 20
# Each attempt takes about 10 seconds, 20 retries is equivalent to 200
# seconds timeout.
for i in range(retry_count):
stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC)

Loading…
Cancel
Save