mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 13:16:53 +00:00
test: Verify leaks at end of WithEnv
Helps track down the individual test leaks.
This commit is contained in:
@ -211,13 +211,19 @@ func (s *scenario) bridgeSendsAnAddressDeletedEventForUser(username string) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *scenario) bridgeSendsSyncStartedAndFinishedEventsForUser(username string) error {
|
func (s *scenario) bridgeSendsSyncStartedAndFinishedEventsForUser(username string) error {
|
||||||
startEvent, ok := awaitType(s.t.events, events.SyncStarted{}, 30*time.Second)
|
wantUserID := s.t.getUserByName(username).getUserID()
|
||||||
if !ok {
|
for {
|
||||||
return errors.New("expected sync started event, got none")
|
startEvent, ok := awaitType(s.t.events, events.SyncStarted{}, 30*time.Second)
|
||||||
}
|
if !ok {
|
||||||
|
return errors.New("expected sync started event, got none")
|
||||||
|
}
|
||||||
|
|
||||||
if wantUserID := s.t.getUserByName(username).getUserID(); startEvent.UserID != wantUserID {
|
// There can be multiple sync events, and some might not be for this user
|
||||||
return fmt.Errorf("expected sync started event for user %s, got %s", wantUserID, startEvent.UserID)
|
if startEvent.UserID != wantUserID {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
finishEvent, ok := awaitType(s.t.events, events.SyncFinished{}, 30*time.Second)
|
finishEvent, ok := awaitType(s.t.events, events.SyncFinished{}, 30*time.Second)
|
||||||
|
|||||||
Reference in New Issue
Block a user