From 057c1d1fafa91665ed6ff64d84f7b6597902afd2 Mon Sep 17 00:00:00 2001 From: Eric Gribkoff Date: Mon, 30 Nov 2020 21:23:46 -0800 Subject: [PATCH] Do not try to generate unique suffix when keep_gcp_resources is set --- tools/run_tests/run_xds_tests.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/run_tests/run_xds_tests.py b/tools/run_tests/run_xds_tests.py index 4802e96957b..40e5232170b 100755 --- a/tools/run_tests/run_xds_tests.py +++ b/tools/run_tests/run_xds_tests.py @@ -1942,11 +1942,13 @@ try: gcp_suffix = args.gcp_suffix health_check_name = _BASE_HEALTH_CHECK_NAME + gcp_suffix if not args.use_existing_gcp_resources: - if gcp_suffix: - num_attempts = 5 - else: - # If not given a suffix, do not retry if already in use. + if args.keep_gcp_resources: + # Auto-generating a unique suffix in case of conflict should not be + # combined with --keep_gcp_resources, as the suffix actually used + # for GCP resources will not match the provided --gcp_suffix value. num_attempts = 1 + else: + num_attempts = 5 for i in range(num_attempts): try: logger.info('Using GCP suffix %s', gcp_suffix)