From 00fda06c4f5d43b8c10112170b55cbab1b49bbcf Mon Sep 17 00:00:00 2001 From: Sainath Nalkari Date: Mon, 29 Sep 2025 13:41:02 +0530 Subject: [PATCH] Added max age for quant tests --- tests/common_parameters.py | 2 ++ tests/test_quant_calculations_api.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/common_parameters.py b/tests/common_parameters.py index 54f2d33a..e27c188f 100644 --- a/tests/common_parameters.py +++ b/tests/common_parameters.py @@ -32,3 +32,5 @@ default_dates_frequency = "Monthly" default_dates_account = "CLIENT:/BISAM/REPOSITORY/QA/SMALL_PORT.ACCT" default_lookup_directory = "client:" +# This is exclusively created for the quant tests to avoid frequent status calls +quant_max_age = '5' if not os.getenv("QUANT_CUSTOM_MAX_AGE") else os.getenv("QUANT_CUSTOM_MAX_AGE") \ No newline at end of file diff --git a/tests/test_quant_calculations_api.py b/tests/test_quant_calculations_api.py index 2350d50d..19848f87 100644 --- a/tests/test_quant_calculations_api.py +++ b/tests/test_quant_calculations_api.py @@ -13,6 +13,7 @@ from fds.analyticsapi.engines.model.quant_calculation_meta import QuantCalculationMeta from common_functions import CommonFunctions from api_workflow import run_api_workflow_with_assertions +import common_parameters class TestQuantCalculationsApi(unittest.TestCase): @@ -98,7 +99,8 @@ def read_calculation_status(test_context): status_response[0].data.status in ("Queued", "Executing"))) while status_response[1] == 202 and (status_response[0].data.status in ("Queued", "Executing")): - max_age = '5' + max_age = common_parameters.quant_max_age + print('max-age: ' + max_age) age_value = status_response[2].get("cache-control") if age_value is not None: max_age = age_value.replace("max-age=", "")