mirror of https://github.com/zulip/zulip.git
test_message_fetch: Fix a flaky test due to random message populated.
The messages populated in the test database are random in nature, so there is a possibility of more than one resolved topic messages returned by 'self.get_and_check_messages()' query in 'test_get_messages_for_resolved_topics'. That would result in a flaky behavior. This commit fixes the flaky behavior.
This commit is contained in:
parent
c1a5b47f41
commit
fd335c06eb
|
@ -3166,7 +3166,7 @@ class GetOldMessagesTest(ZulipTestCase):
|
|||
|
||||
narrow = [dict(operator="is", operand="resolved")]
|
||||
result = self.get_and_check_messages(
|
||||
dict(narrow=orjson.dumps(narrow).decode(), anchor=anchor, num_before=1, num_after=1)
|
||||
dict(narrow=orjson.dumps(narrow).decode(), anchor=anchor, num_before=0, num_after=0)
|
||||
)
|
||||
self.assert_length(result["messages"], 1)
|
||||
self.assertEqual(result["messages"][0]["id"], anchor)
|
||||
|
|
Loading…
Reference in New Issue