From 83dc98bdfb5e4f2f153c8b00803650e7efe69be3 Mon Sep 17 00:00:00 2001 From: David Cavazos Date: Wed, 16 Sep 2020 09:41:00 -0700 Subject: [PATCH] Slightly increase max retry time in test Fixes #4686 It should be an uncommon occurrence that a job hangs in queue for more than 4 minutes, probably because many tests were triggered at a similar time. I'm slightly increasing the max retry time to 5 minutes to leave more room for jobs to be cancelled, but most of the time it will be cancelled much quicker. --- dataflow/run_template/main_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dataflow/run_template/main_test.py b/dataflow/run_template/main_test.py index ec48ea9147bc..248bc8f476aa 100644 --- a/dataflow/run_template/main_test.py +++ b/dataflow/run_template/main_test.py @@ -34,6 +34,8 @@ import main +RETRY_MAX_TIME = 5 * 60 # 5 minutes in seconds + PROJECT = os.environ['GOOGLE_CLOUD_PROJECT'] BUCKET = os.environ['CLOUD_STORAGE_BUCKET'] @@ -83,7 +85,7 @@ def get_job_id_from_name(job_name): # We retry the cancel operation a few times until the job is in a state where it can be cancelled -@backoff.on_exception(backoff.expo, HttpError, max_time=240) +@backoff.on_exception(backoff.expo, HttpError, max_time=RETRY_MAX_TIME) def dataflow_jobs_cancel(job_name): # to cancel a dataflow job, we need its ID, not its name job_id = get_job_id_from_name(job_name)