feat(GODT-2144): Delay IMAP/SMTP server start until all users are loaded

This commit is contained in:
James Houlahan
2023-02-01 12:58:44 +01:00
parent c3d5a0b8f8
commit 62285a141e
5 changed files with 159 additions and 52 deletions

View File

@ -671,6 +671,10 @@ func withBridgeNoMocks(
// Wait for bridge to finish loading users.
waitForEvent(t, eventCh, events.AllUsersLoaded{})
// Wait for bridge to start the IMAP server.
waitForEvent(t, eventCh, events.IMAPServerReady{})
// Wait for bridge to start the SMTP server.
waitForEvent(t, eventCh, events.SMTPServerReady{})
// Set random IMAP and SMTP ports for the tests.
require.NoError(t, bridge.SetIMAPPort(0))