mirror of https://github.com/zulip/zulip.git
test_retention: Improve and extent print-debugging.
We needed flush=True to have output not be lost. Also print the original messages, so we can compare what's missing.
This commit is contained in:
parent
c1538fd0f5
commit
55b15ba117
|
@ -259,6 +259,7 @@ class TestRetentionLib(ZulipTestCase):
|
||||||
timezone_now() - timedelta(days=MIT_REALM_DAYS + 1)
|
timezone_now() - timedelta(days=MIT_REALM_DAYS + 1)
|
||||||
)
|
)
|
||||||
expected_message_ids = expected_message_ids_dict['mit_msgs_ids'] + expected_message_ids_dict['zulip_msgs_ids']
|
expected_message_ids = expected_message_ids_dict['mit_msgs_ids'] + expected_message_ids_dict['zulip_msgs_ids']
|
||||||
|
print(Message.objects.filter(id__in=expected_message_ids), flush=True)
|
||||||
|
|
||||||
# Get expired user messages by message ids
|
# Get expired user messages by message ids
|
||||||
expected_user_msgs_ids = list(UserMessage.objects.filter(
|
expected_user_msgs_ids = list(UserMessage.objects.filter(
|
||||||
|
@ -268,8 +269,8 @@ class TestRetentionLib(ZulipTestCase):
|
||||||
archive_messages()
|
archive_messages()
|
||||||
|
|
||||||
# Temporary debugging code while we investigate CI failures
|
# Temporary debugging code while we investigate CI failures
|
||||||
print(expected_message_ids)
|
print(expected_message_ids, flush=True)
|
||||||
print(ArchivedMessage.objects.all())
|
print(ArchivedMessage.objects.all(), flush=True)
|
||||||
|
|
||||||
# Compare archived messages and user messages with expired messages
|
# Compare archived messages and user messages with expired messages
|
||||||
self.assertEqual(ArchivedMessage.objects.count(), len(expected_message_ids))
|
self.assertEqual(ArchivedMessage.objects.count(), len(expected_message_ids))
|
||||||
|
|
Loading…
Reference in New Issue