fix_: flaky TestJoinCommunityAsMemberWithMemberAndAdminPermission
`waitOnCommunitiesEvent` must be invoked before action that triggers the event. fixes: #4760
This commit is contained in:
parent
568e07d2eb
commit
97af3f7e52
|
@ -959,14 +959,15 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinCommunityAsMemberWit
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
response, err = s.owner.CreateCommunityTokenPermission(&permissionRequestAdmin)
|
|
||||||
s.Require().NoError(err)
|
|
||||||
s.Require().Len(response.Communities(), 1)
|
|
||||||
|
|
||||||
waitOnCommunityPermissionCreated = waitOnCommunitiesEvent(s.owner, func(sub *communities.Subscription) bool {
|
waitOnCommunityPermissionCreated = waitOnCommunitiesEvent(s.owner, func(sub *communities.Subscription) bool {
|
||||||
return len(sub.Community.TokenPermissions()) == 2
|
return len(sub.Community.TokenPermissions()) == 2
|
||||||
})
|
})
|
||||||
|
|
||||||
|
response, err = s.owner.CreateCommunityTokenPermission(&permissionRequestAdmin)
|
||||||
|
s.Require().NoError(err)
|
||||||
|
s.Require().Len(response.Communities(), 1)
|
||||||
|
|
||||||
err = <-waitOnCommunityPermissionCreated
|
err = <-waitOnCommunityPermissionCreated
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue