Skip to content

Commit b02b8ac

Browse files
committed
add logging for failing test
1 parent 16b4d2d commit b02b8ac

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/sentry/deletions/test_group.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,14 @@ def tenant_ids(self) -> dict[str, str]:
386386
def test_simple_issue_platform(self) -> None:
387387
# Adding this query here to make sure that the cache is not being used
388388
assert self.select_error_events(self.project.id) is None
389-
assert self.select_issue_platform_events(self.project.id) is None
389+
initial_issue_platform_data = self.select_issue_platform_events(self.project.id)
390+
assert initial_issue_platform_data is None, (
391+
f"Expected no issue platform events for new project {self.project.id}, "
392+
f"but found: event_id={initial_issue_platform_data.get('event_id') if initial_issue_platform_data else None}, "
393+
f"group_id={initial_issue_platform_data.get('group_id') if initial_issue_platform_data else None}, "
394+
f"occurrence_id={initial_issue_platform_data.get('occurrence_id') if initial_issue_platform_data else None}. "
395+
f"This suggests reset_snuba fixture is not properly cleaning up the search_issues dataset."
396+
)
390397

391398
# Create initial error event and occurrence related to it; two different groups will exist
392399
event = self.store_event(data={}, project_id=self.project.id)
@@ -436,7 +443,13 @@ def test_simple_issue_platform(self) -> None:
436443
# The Issue Platform group and occurrence have been deleted
437444
assert not Group.objects.filter(id=issue_platform_group.id).exists()
438445
# assert not nodestore.backend.get(occurrence_node_id)
439-
assert self.select_issue_platform_events(self.project.id) is None
446+
final_issue_platform_data = self.select_issue_platform_events(self.project.id)
447+
assert final_issue_platform_data is None, (
448+
f"Expected issue platform events to be deleted, but found data in Snuba.\n"
449+
f"Expected (deleted): event_id={occurrence_event.event_id}, "
450+
f"group_id={issue_platform_group.id}, occurrence_id={occurrence_event.id}\n"
451+
f"Found: {final_issue_platform_data}"
452+
)
440453

441454
@mock.patch("sentry.deletions.tasks.nodestore.bulk_snuba_queries")
442455
def test_issue_platform_batching(self, mock_bulk_snuba_queries: mock.Mock) -> None:

0 commit comments

Comments
 (0)