From 516563043f4f41f3217e88640bd342d0fb22b810 Mon Sep 17 00:00:00 2001 From: Alex Hong <9397363+hongalex@users.noreply.github.com> Date: Fri, 18 Aug 2023 12:45:07 -0700 Subject: [PATCH] test(pubsub): remove brittle custom retry test (#8443) --- pubsub/pubsub_test.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/pubsub/pubsub_test.go b/pubsub/pubsub_test.go index 247fda1b47c7..6c741a4aba5f 100644 --- a/pubsub/pubsub_test.go +++ b/pubsub/pubsub_test.go @@ -16,7 +16,6 @@ package pubsub import ( "context" - "fmt" "testing" "time" @@ -30,41 +29,6 @@ import ( "google.golang.org/grpc/status" ) -func TestClient_CustomRetry(t *testing.T) { - ctx := context.Background() - pco := &vkit.PublisherCallOptions{ - Publish: []gax.CallOption{ - gax.WithRetry(func() gax.Retryer { - return gax.OnCodes([]codes.Code{ - codes.Unavailable, codes.DeadlineExceeded, - }, gax.Backoff{ - Initial: 200 * time.Millisecond, - Max: 30000 * time.Millisecond, - Multiplier: 1.25, - }) - }), - }, - } - sco := &vkit.SubscriberCallOptions{} - c, err := NewClientWithConfig(ctx, "some-project", &ClientConfig{PublisherCallOptions: pco, SubscriberCallOptions: sco}) - if err != nil { - t.Fatalf("failed to create client with config: %v", err) - } - - cs := &gax.CallSettings{} - // This is the default retry setting. - c.pubc.CallOptions.Publish[1].Resolve(cs) - if got, want := fmt.Sprintf("%v", cs.Retry()), "&{{100000000 60000000000 1.3 0} [10 1 13 8 2 14 4]}"; got != want { - t.Fatalf("got: %v, want: %v", got, want) - } - - // This is the custom retry setting. - c.pubc.CallOptions.Publish[2].Resolve(cs) - if got, want := fmt.Sprintf("%v", cs.Retry()), "&{{200000000 30000000000 1.25 0} [14 4]}"; got != want { - t.Fatalf("merged CallOptions is incorrect: got %v, want %v", got, want) - } -} - func TestClient_ApplyClientConfig(t *testing.T) { ctx := context.Background() srv := pstest.NewServer()