mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 13:16:53 +00:00
GODT-1657: Stable sync (still needs more tests)
This commit is contained in:
@ -39,10 +39,10 @@ func init() {
|
||||
certs.GenerateCert = FastGenerateCert
|
||||
|
||||
// Set the event period to 100 milliseconds for more responsive tests.
|
||||
user.DefaultEventPeriod = 100 * time.Millisecond
|
||||
user.EventPeriod = 100 * time.Millisecond
|
||||
|
||||
// Don't use jitter during tests.
|
||||
user.DefaultEventJitter = 0
|
||||
user.EventJitter = 0
|
||||
}
|
||||
|
||||
type scenario struct {
|
||||
|
||||
@ -137,7 +137,7 @@ func (s *scenario) bridgeSendsADeauthEventForUser(username string) error {
|
||||
}
|
||||
|
||||
func (s *scenario) bridgeSendsAnAddressCreatedEventForUser(username string) error {
|
||||
return try(s.t.addrCreatedCh, 5*time.Second, func(event events.UserAddressCreated) error {
|
||||
return try(s.t.addrCreatedCh, 60*time.Second, func(event events.UserAddressCreated) error {
|
||||
if wantUserID := s.t.getUserID(username); wantUserID != event.UserID {
|
||||
return fmt.Errorf("expected user address created event for user with ID %s, got %s", wantUserID, event.UserID)
|
||||
}
|
||||
@ -147,7 +147,7 @@ func (s *scenario) bridgeSendsAnAddressCreatedEventForUser(username string) erro
|
||||
}
|
||||
|
||||
func (s *scenario) bridgeSendsAnAddressDeletedEventForUser(username string) error {
|
||||
return try(s.t.addrDeletedCh, 5*time.Second, func(event events.UserAddressDeleted) error {
|
||||
return try(s.t.addrDeletedCh, 60*time.Second, func(event events.UserAddressDeleted) error {
|
||||
if wantUserID := s.t.getUserID(username); wantUserID != event.UserID {
|
||||
return fmt.Errorf("expected user address deleted event for user with ID %s, got %s", wantUserID, event.UserID)
|
||||
}
|
||||
|
||||
@ -138,9 +138,9 @@ func (s *scenario) theAddressOfAccountHasMessagesInMailbox(address, username str
|
||||
|
||||
for idx := 0; idx < count; idx++ {
|
||||
messageID, err := s.t.api.CreateMessage(userID, addrID, Message{
|
||||
Subject: fmt.Sprintf("subject %d", idx),
|
||||
To: fmt.Sprintf("to %d", idx),
|
||||
From: fmt.Sprintf("from %d", idx),
|
||||
Subject: fmt.Sprintf("%d", idx),
|
||||
To: fmt.Sprintf("%d@pm.me", idx),
|
||||
From: fmt.Sprintf("%d@pm.me", idx),
|
||||
Body: fmt.Sprintf("body %d", idx),
|
||||
}.Build(), liteapi.MessageFlagReceived, idx%2 == 0, false)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user