Fix/flaky test sync installation (#3452)

* fix flaky test: sync installation

* bump version

* fix error description
This commit is contained in:
frank 2023-05-05 14:44:26 +08:00 committed by GitHub
parent 3f932fa938
commit a8fe8edd45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -1 +1 @@
0.149.1
0.149.2

View File

@ -246,6 +246,7 @@ func (s *MessengerInstallationSuite) TestSyncInstallation() {
var allChats []*Chat
var actualContact *Contact
var bookmarks []*browsers.Bookmark
// Wait for the message to reach its destination
err = tt.RetryWithBackOff(func() error {
var err error
@ -258,12 +259,13 @@ func (s *MessengerInstallationSuite) TestSyncInstallation() {
if len(response.Contacts) == 1 {
actualContact = response.Contacts[0]
}
bookmarks = append(bookmarks, response.GetBookmarks()...)
if len(allChats) >= 2 && actualContact != nil {
if len(allChats) >= 2 && actualContact != nil && len(bookmarks) >= 1 {
return nil
}
return errors.New("Not received all chats & contacts")
return errors.New("not received all chats & contacts & bookmarks yet")
})
@ -287,7 +289,7 @@ func (s *MessengerInstallationSuite) TestSyncInstallation() {
s.Require().True(actualContact.hasAddedUs())
s.Require().True(actualContact.mutual())
bookmarks, err := theirMessenger.browserDatabase.GetBookmarks()
bookmarks, err = theirMessenger.browserDatabase.GetBookmarks()
s.Require().NoError(err)
s.Require().Equal(1, len(bookmarks))