From 55b15ba1171fe5a3c4602e31fea156d5ab93c541 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 21 May 2019 09:28:03 -0700 Subject: [PATCH] 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. --- zerver/tests/test_retention.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zerver/tests/test_retention.py b/zerver/tests/test_retention.py index dedcc68c0f..955fc2c82a 100644 --- a/zerver/tests/test_retention.py +++ b/zerver/tests/test_retention.py @@ -259,6 +259,7 @@ class TestRetentionLib(ZulipTestCase): 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'] + print(Message.objects.filter(id__in=expected_message_ids), flush=True) # Get expired user messages by message ids expected_user_msgs_ids = list(UserMessage.objects.filter( @@ -268,8 +269,8 @@ class TestRetentionLib(ZulipTestCase): archive_messages() # Temporary debugging code while we investigate CI failures - print(expected_message_ids) - print(ArchivedMessage.objects.all()) + print(expected_message_ids, flush=True) + print(ArchivedMessage.objects.all(), flush=True) # Compare archived messages and user messages with expired messages self.assertEqual(ArchivedMessage.objects.count(), len(expected_message_ids))