Skip to content

Commit

Permalink
[qualifier] make dss_interop more resilient to possible api delays
Browse files Browse the repository at this point in the history
  • Loading branch information
Shastick committed Feb 23, 2024
1 parent 69e3adf commit e6e5956
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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")
Expand Down

0 comments on commit e6e5956

Please sign in to comment.