Skip to content

Commit be87cf8

Browse files
ref: fix flaky digests test (#81256)
relay [rounds timestamps](https://github.com/getsentry/relay/blob/0459abec0ee79f773d163f35e742cebd34134793/relay-event-schema/src/protocol/types.rs#L896) whereas the test truncates I first forced the test to fail with: ```diff diff --git a/tests/sentry/notifications/notifications/test_digests.py b/tests/sentry/notifications/notifications/test_digests.py index be02406..2943b1875e 100644 --- a/tests/sentry/notifications/notifications/test_digests.py +++ b/tests/sentry/notifications/notifications/test_digests.py @@ -163,7 +163,10 @@ class DigestSlackNotification(SlackActivityNotificationTest): backend = RedisBackend() digests.backend.digest = backend.digest digests.enabled.return_value = True - timestamp_raw = before_now(days=1) + while True: + timestamp_raw = before_now(days=1) + if int(timestamp_raw.timestamp()) != round(timestamp_raw.timestamp()): + break timestamp_secs = int(timestamp_raw.timestamp()) timestamp = timestamp_raw.isoformat() key = f"slack:p:{self.project.id}:IssueOwners::AllMembers" ``` <!-- Describe your PR here. -->
1 parent 52f5b44 commit be87cf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/sentry/notifications/notifications/test_digests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def test_slack_digest_notification_block(self, digests):
163163
backend = RedisBackend()
164164
digests.backend.digest = backend.digest
165165
digests.enabled.return_value = True
166-
timestamp_raw = before_now(days=1)
166+
timestamp_raw = before_now(days=1).replace(microsecond=0)
167167
timestamp_secs = int(timestamp_raw.timestamp())
168168
timestamp = timestamp_raw.isoformat()
169169
key = f"slack:p:{self.project.id}:IssueOwners::AllMembers"

0 commit comments

Comments
 (0)