fix flaky test `TestSyncCommunityRequestDecisionAccept` (#4257)

This commit is contained in:
frank 2023-11-03 18:55:44 +08:00 committed by GitHub
parent c76ca62375
commit f36b943202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -170,7 +170,13 @@ func (s *MessengerSyncActivityCenterSuite) addContactAndShareCommunity(userB *Me
response, err := userB.AddContact(context.Background(), request)
s.Require().NoError(err)
s.Require().Len(response.Messages(), 2)
s.Require().Equal(protobuf.ChatMessage_CONTACT_REQUEST, response.Messages()[1].ContentType)
existContactRequestMessage := false
for _, m := range response.Messages() {
if m.ContentType == protobuf.ChatMessage_CONTACT_REQUEST {
existContactRequestMessage = true
}
}
s.Require().True(existContactRequestMessage)
var contactRequestMessageID types.HexBytes
_, err = WaitOnMessengerResponse(s.m, func(r *MessengerResponse) bool {
if len(r.ActivityCenterNotifications()) > 0 {