GODT-1409 Wait in GetEvents during message preparation for live API.

This commit is contained in:
Jakub
2021-11-19 09:40:57 +01:00
parent 1d9855a190
commit 59075f2e26
6 changed files with 65 additions and 0 deletions

View File

@ -75,6 +75,13 @@ func thereAreMessagesInMailboxesForUser(mailboxNames, bddUserID string, messages
}
func thereAreMessagesInMailboxesForAddressOfUser(mailboxNames, bddAddressID, bddUserID string, messages *godog.Table) error {
// It is needed to prevent event processing before syncing these message
// otherwise the seqID and UID will be in reverse order. The
// synchronization add newest message first, the eventloop adds the oldest
// message first.
ctx.MessagePreparationStarted()
defer ctx.MessagePreparationFinished()
account := ctx.GetTestAccountWithAddress(bddUserID, bddAddressID)
if account == nil {
return godog.ErrPending
@ -263,6 +270,13 @@ func processMailboxStructureDataTable(structure *godog.Table, callback func(stri
}
func thereAreSomeMessagesInMailboxesForAddressOfUser(numberOfMessages int, mailboxNames, bddAddressID, bddUserID string) error {
// It is needed to prevent event processing before syncing these message
// otherwise the seqID and UID will be in reverse order. The
// synchronization add newest message first, the eventloop adds the oldest
// message first.
ctx.MessagePreparationStarted()
defer ctx.MessagePreparationFinished()
account := ctx.GetTestAccountWithAddress(bddUserID, bddAddressID)
if account == nil {
return godog.ErrPending