From e6e595670bb71fb7d43fe6aef201b8bbdff74322 Mon Sep 17 00:00:00 2001 From: Julien Perrochet Date: Fri, 23 Feb 2024 10:07:19 +0100 Subject: [PATCH] [qualifier] make dss_interop more resilient to possible api delays --- .../netrid/common/dss_interoperability.py | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/monitoring/uss_qualifier/scenarios/astm/netrid/common/dss_interoperability.py b/monitoring/uss_qualifier/scenarios/astm/netrid/common/dss_interoperability.py index fb5ded23af..b3c8e40499 100644 --- a/monitoring/uss_qualifier/scenarios/astm/netrid/common/dss_interoperability.py +++ b/monitoring/uss_qualifier/scenarios/astm/netrid/common/dss_interoperability.py @@ -36,13 +36,12 @@ def _default_params(duration: datetime.timedelta) -> Dict: alt_hi=400, start_time=now, end_time=now + duration, - uss_base_url="https://example.com", + uss_base_url="https://example.interuss.org", ) SHORT_WAIT_SEC = 5 - class EntityType(str, Enum): ISA = "ISA" Sub = "Sub" @@ -268,7 +267,7 @@ def get_fail_params( ) def step3(self): - """Can retrieve specific Subscription emplaced in primary DSS + """Can retrieve specific Subscription created in primary DSS from all DSSs.""" sub_1_0 = self._context["sub_1_0"] @@ -515,7 +514,12 @@ def step9(self): created_sub = dss.put_sub( check, sub_id=sub_2.uuid, - **_default_params(datetime.timedelta(seconds=SHORT_WAIT_SEC)), + **_default_params( + # This duration needs to allow us to create and delete an ISA that will + # trigger the notifications, but needs to be short enough for the test to be able + # to wait for their expiry. + datetime.timedelta(seconds=SHORT_WAIT_SEC) + ), ) sub_2.version = created_sub.subscription.version @@ -544,6 +548,7 @@ def step10(self): mutated_isa = self._dss_primary.put_isa( check, isa_id=isa_2.uuid, + do_not_notify=list(all_sub_2_ids), # Do not attempt to notify our own subscriptions **_default_params(datetime.timedelta(minutes=10)), ) isa_2.version = mutated_isa.dss_query.isa.version @@ -572,7 +577,10 @@ def step11(self): "ISA[P] deleted with proper response", [self._dss_primary.participant_id] ) as check: del_isa = self._dss_primary.del_isa( - check, isa_id=isa_2.uuid, isa_version=isa_2.version + check, + isa_id=isa_2.uuid, + isa_version=isa_2.version, + do_not_notify=list(all_sub_2_ids), # Do not attempt to notify our own subscriptions ) with self.check( @@ -594,7 +602,7 @@ def step12(self): sleep( SHORT_WAIT_SEC, - "ISA needs to expire so we can check it doesn't trigger notifications", + "Subscriptions needs to expire so we can check they don't trigger notifications", ) isa_3 = self._new_isa("isa_3")