Skip to content

Commit

Permalink
[uss_qualifier] Don't use participant notification URLs as participan…
Browse files Browse the repository at this point in the history
…t IDs (#303)
  • Loading branch information
Shastick authored Nov 2, 2023
1 parent 2b9fff0 commit cf9772d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,19 @@ def _delete_isa_if_exists(self):
query_timestamps=[deleted.dss_query.query.request.timestamp],
)
for subscriber_url, notification in deleted.notifications.items():
with self.check("Notified subscriber", [subscriber_url]) as check:
# TODO: Find a better way to identify a subscriber who couldn't be notified
if not notification.success:
check.record_failed(
"Could not notify ISA subscriber",
Severity.Medium,
f"Attempting to notify subscriber for ISA {self._isa_id} at {subscriber_url} resulted in {notification.status_code}",
query_timestamps=[notification.query.request.timestamp],
)
# For checking the notifications, we ignore the request we made for the subscription that we created.
if self._isa.base_url not in subscriber_url:
pid = notification.query.participant_id
with self.check(
"Notified subscriber", [pid] if pid else []
) as check:
if not notification.success:
check.record_failed(
"Could not notify ISA subscriber",
Severity.Medium,
f"Attempting to notify subscriber for ISA {self._isa_id} at {subscriber_url} resulted in {notification.status_code}",
query_timestamps=[notification.query.request.timestamp],
)

def _get_isa_by_id_step(self):
self.begin_test_step("Get ISA by ID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def delete_isa_if_exists(
)

for subscriber_url, notification in deleted.notifications.items():
with scenario.check("Notified subscriber", [subscriber_url]) as check:
# TODO: Find a better way to identify a subscriber who couldn't be notified
pid = notification.query.participant_id
with scenario.check("Notified subscriber", [pid] if pid else []) as check:
if not notification.success:
check.record_failed(
"Could not notify ISA subscriber",
Expand Down

0 comments on commit cf9772d

Please sign in to comment.