From cdc75399b2399cdcc95a06371cde9cd94356d9d8 Mon Sep 17 00:00:00 2001 From: Drew Meyers Date: Mon, 10 Apr 2023 09:19:36 -0700 Subject: [PATCH] Add backoff to request_job_status_by_id --- unity-test/step_defs/test_get_processing_status.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/unity-test/step_defs/test_get_processing_status.py b/unity-test/step_defs/test_get_processing_status.py index b16feda..f9fc083 100644 --- a/unity-test/step_defs/test_get_processing_status.py +++ b/unity-test/step_defs/test_get_processing_status.py @@ -1,4 +1,6 @@ -from pytest_bdd import scenario, given, when, then, parsers +from pytest_bdd import scenario, given, when, then +import backoff +import requests from .conftest import FEATURES_DIR, _request_job_status_by_id @@ -23,6 +25,13 @@ def created_response(response): "a WPS-T request is made to get the status of the job by its ID", target_fixture="response", ) +@backoff.on_exception( + backoff.constant, + (requests.exceptions.HTTPError), + max_time=3600, + jitter=None, + interval=1, +) def request_job_status_by_id(process_service_endpoint, project_process_dict, job_id): return _request_job_status_by_id( process_service_endpoint,