From 2b7391baf2ca974e195ad9304a134b803f1f3be7 Mon Sep 17 00:00:00 2001 From: Julien Perrochet Date: Thu, 9 May 2024 00:16:03 +0200 Subject: [PATCH] [uss_qualifier] SCD's SubscriptionSimple scenario: initialise parameters at execution time (#686) --- .../scenarios/astm/utm/dss/subscription_simple.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/subscription_simple.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/subscription_simple.py index 05da2b37e6..e0f8f9c57a 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/subscription_simple.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/subscription_simple.py @@ -99,7 +99,12 @@ def __init__( self._base_sub_id[:-1] + f"{i}" for i in range(4) ] - self._sub_generation_params = self._planning_area.get_new_subscription_params( + self._problematically_big_area_vol = Polygon( + vertices=problematically_big_area.specification.vertices + ) + + def _build_current_time_sub_params(self): + return self._planning_area.get_new_subscription_params( subscription_id="", # subscription ID will need to be overwritten # Set this slightly in the past: we will update the subscriptions # to a later value that still needs to be roughly 'now' without getting into the future @@ -110,10 +115,6 @@ def __init__( notify_for_constraints=False, ) - self._problematically_big_area_vol = Polygon( - vertices=problematically_big_area.specification.vertices - ) - def run(self, context: ExecutionContext): self.begin_test_scenario(context) self._setup_case() @@ -154,6 +155,9 @@ def _setup_case(self): # thus we need to reset the state of the scenario before running it. self._current_subscriptions = {} self._sub_params_by_sub_id = {} + # The subscription needs to be reasonably close to 'now': + # We reset it at the beginning of each run. + self._sub_generation_params = self._build_current_time_sub_params() self._ensure_clean_workspace_step()