From d238c2bb28ba58a5c989f1bf360ffdecd8831dad Mon Sep 17 00:00:00 2001 From: Steven Normore Date: Mon, 25 Sep 2023 14:30:45 -0400 Subject: [PATCH] e2e: add delay if sync hits rate limit --- pkg/e2e/test_messagev1.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/e2e/test_messagev1.go b/pkg/e2e/test_messagev1.go index 307b2622..25df308f 100644 --- a/pkg/e2e/test_messagev1.go +++ b/pkg/e2e/test_messagev1.go @@ -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 { @@ -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)] {