Fix flaky integration tests

This commit is contained in:
Michal Horejsek
2020-06-26 11:35:47 +02:00
parent b6707749e5
commit 813e99f399
2 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
* Ensure DoH is used at startup to load users for the initial auth.
* Issue causing deadlock when reloading users keys due to double-locking of a mutex.
* Correctly handle failure to unlock single key.
* GODT-479 Fix flaky integration tests.
## [v1.2.7] Donghai-hotfix - beta (2020-05-07)

View File

@ -28,6 +28,17 @@ import (
// TestSync triggers a sync of the store.
func (store *Store) TestSync() {
store.lock.Lock()
defer store.lock.Unlock()
// Sync can happen any time. Sync assigns sequence numbers and UIDs
// in the order of fetching from the server. We expect in the test
// that sequence numbers and UIDs are assigned in the same order as
// written in scenario setup. With more than one sync that cannot
// be guaranteed so once test calls this function, first it has to
// delete previous any already synced sequence numbers and UIDs.
_ = store.truncateMailboxesBucket()
store.triggerSync()
}