From 609fd3c01b44974861f4bd024afedf9d25b0acda Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Wed, 13 Jan 2021 15:03:15 -0800 Subject: [PATCH] xds testing: make header matching and path matching fail properly --- tools/run_tests/run_xds_tests.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/run_tests/run_xds_tests.py b/tools/run_tests/run_xds_tests.py index 6b397d49b95..8e712375afc 100755 --- a/tools/run_tests/run_xds_tests.py +++ b/tools/run_tests/run_xds_tests.py @@ -991,8 +991,8 @@ def test_path_matching(gcp, original_backend_service, instance_group, original_backend_instances + alternate_backend_instances, _WAIT_FOR_STATS_SEC) - retry_count = 20 - # Each attempt takes about 10 seconds, 20 retries is equivalent to 200 + retry_count = 40 + # Each attempt takes about 10 seconds, 40 retries is equivalent to 400 # seconds timeout. for i in range(retry_count): stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC) @@ -1004,6 +1004,10 @@ def test_path_matching(gcp, original_backend_service, instance_group, if compare_expected_instances(stats, expected_instances): logger.info("success") break + elif i == retry_count - 1: + raise Exception( + 'timeout waiting for RPCs to the expected instances: %s' + % expected_instances) finally: patch_url_map_backend_service(gcp, original_backend_service) patch_backend_service(gcp, alternate_backend_service, []) @@ -1121,8 +1125,8 @@ def test_header_matching(gcp, original_backend_service, instance_group, original_backend_instances + alternate_backend_instances, _WAIT_FOR_STATS_SEC) - retry_count = 20 - # Each attempt takes about 10 seconds, 10 retries is equivalent to 100 + retry_count = 40 + # Each attempt takes about 10 seconds, 40 retries is equivalent to 400 # seconds timeout. for i in range(retry_count): stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC) @@ -1134,6 +1138,10 @@ def test_header_matching(gcp, original_backend_service, instance_group, if compare_expected_instances(stats, expected_instances): logger.info("success") break + elif i == retry_count - 1: + raise Exception( + 'timeout waiting for RPCs to the expected instances: %s' + % expected_instances) finally: patch_url_map_backend_service(gcp, original_backend_service) patch_backend_service(gcp, alternate_backend_service, [])