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:
Tim Abbott 2019-05-21 09:28:03 -07:00
parent c1538fd0f5
commit 55b15ba117
1 changed files with 3 additions and 2 deletions

View File

@ -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))