data-store
data-store copied to clipboard
DSS NotifyV2: Subscription URL Stats
inserts statistics about DSS -> callback url interaction on a per subscription basis Connected To: #2255
@amarjandu adding the enums caused mypy errors, did my best to fix in #2500 but was not able to resolve new errors:
======================================================================
ERROR: test_notify_or_queue (__main__.TestNotifyV2) [Should queue when notify fails]
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/test_notify_v2.py", line 163, in test_notify_or_queue
notify_or_queue(Replica.aws, subscription, md, key)
File "/Users/charles/codes/data-store3/dss/events/handlers/notify_v2.py", line 86, in notify_or_queue
sqsm.send(_format_sqs_message(replica, subscription, event_type, key), delay_seconds=15 * 60)
File "/Users/charles/codes/data-store3/dss/events/handlers/notify_v2.py", line 184, in _format_sqs_message
SubscriptionData.OWNER: subscription['owner'],
KeyError: 'owner'
======================================================================
ERROR: test_notify_or_queue (__main__.TestNotifyV2) [notify_or_queue should queue notifications for unversioned tombstone]
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/test_notify_v2.py", line 200, in test_notify_or_queue
notify_or_queue(Replica.aws, subscription, md, unversioned_tombstone_key)
File "/Users/charles/codes/data-store3/dss/events/handlers/notify_v2.py", line 79, in notify_or_queue
sqsm.send(_format_sqs_message(replica, subscription, event_type, key), delay_seconds=0)
File "/Users/charles/codes/data-store3/dss/events/handlers/notify_v2.py", line 184, in _format_sqs_message
SubscriptionData.OWNER: subscription['owner'],
KeyError: 'owner'
======================================================================
ERROR: test_notify_or_queue (__main__.TestNotifyV2) [notify_or_queue should not re-queue tombstones versions of unversioned tombstones]
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/test_notify_v2.py", line 220, in test_notify_or_queue
notify_or_queue(Replica.aws, subscription, md, unversioned_tombstone_key)
File "/Users/charles/codes/data-store3/dss/events/handlers/notify_v2.py", line 79, in notify_or_queue
sqsm.send(_format_sqs_message(replica, subscription, event_type, key), delay_seconds=0)
File "/Users/charles/codes/data-store3/dss/events/handlers/notify_v2.py", line 184, in _format_sqs_message
SubscriptionData.OWNER: subscription['owner'],
KeyError: 'owner'
Looks like this is related to the problem of empty subscriptions breaking notifier code (since empty subscriptions have no "body" field): https://humancellatlas.slack.com/archives/GLVNE7UAH/p1571246888007700
Do you have a no-body subscription in your tests, or is this test actually hitting the live dynamodb database with the blank subscription in it?