Skip to content

Commit 64464f8

Browse files
davidcavazoskurtisvgbusunkim96
authored
dataflow/run_template: slightly increase max retry time in test (#4692)
* 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. * Update dataflow/run_template/main_test.py Co-authored-by: Bu Sun Kim <[email protected]> Co-authored-by: Kurtis Van Gent <[email protected]> Co-authored-by: Bu Sun Kim <[email protected]>
1 parent f60929f commit 64464f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dataflow/run_template/main_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import main
3535

3636

37+
RETRY_MAX_TIME = 5 * 60 # 5 minutes in seconds
38+
3739
PROJECT = os.environ['GOOGLE_CLOUD_PROJECT']
3840
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
3941

@@ -83,7 +85,7 @@ def get_job_id_from_name(job_name):
8385

8486

8587
# We retry the cancel operation a few times until the job is in a state where it can be cancelled
86-
@backoff.on_exception(backoff.expo, HttpError, max_time=240)
88+
@backoff.on_exception(backoff.expo, HttpError, max_time=RETRY_MAX_TIME)
8789
def dataflow_jobs_cancel(job_name):
8890
# to cancel a dataflow job, we need its ID, not its name
8991
job_id = get_job_id_from_name(job_name)

0 commit comments

Comments
 (0)