Skip to content

Commit

Permalink
e2e: add delay if sync hits rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
snormore committed Sep 25, 2023
1 parent d561a50 commit d238c2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/e2e/test_messagev1.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ syncLoop:
for i := range clients {
var done bool
for !done {
ctx, cancel := context.WithTimeout(ctx, 500*time.Millisecond)
ctx, cancel := context.WithTimeout(ctx, 2*time.Second)
env, err := streams[i].Next(ctx)
cancel()
if err != nil {
Expand All @@ -87,6 +87,10 @@ syncLoop:
prevSyncEnvs[string(syncEnv.Message)] = true
continue syncLoop
}
if strings.Contains(err.Error(), "429 Too Many Requests") {
s.log.Info("waiting for subscription sync", zap.Int("client", i), zap.Error(err))
time.Sleep(1 * time.Minute)
}
return errors.Wrap(err, "reading sync envelope")
}
if prevSyncEnvs[string(env.Message)] {
Expand Down

0 comments on commit d238c2b

Please sign in to comment.