Skip to content

Commit 5165630

Browse files
authored
test(pubsub): remove brittle custom retry test (#8443)
1 parent 37cccaf commit 5165630

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

pubsub/pubsub_test.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package pubsub
1616

1717
import (
1818
"context"
19-
"fmt"
2019
"testing"
2120
"time"
2221

@@ -30,41 +29,6 @@ import (
3029
"google.golang.org/grpc/status"
3130
)
3231

33-
func TestClient_CustomRetry(t *testing.T) {
34-
ctx := context.Background()
35-
pco := &vkit.PublisherCallOptions{
36-
Publish: []gax.CallOption{
37-
gax.WithRetry(func() gax.Retryer {
38-
return gax.OnCodes([]codes.Code{
39-
codes.Unavailable, codes.DeadlineExceeded,
40-
}, gax.Backoff{
41-
Initial: 200 * time.Millisecond,
42-
Max: 30000 * time.Millisecond,
43-
Multiplier: 1.25,
44-
})
45-
}),
46-
},
47-
}
48-
sco := &vkit.SubscriberCallOptions{}
49-
c, err := NewClientWithConfig(ctx, "some-project", &ClientConfig{PublisherCallOptions: pco, SubscriberCallOptions: sco})
50-
if err != nil {
51-
t.Fatalf("failed to create client with config: %v", err)
52-
}
53-
54-
cs := &gax.CallSettings{}
55-
// This is the default retry setting.
56-
c.pubc.CallOptions.Publish[1].Resolve(cs)
57-
if got, want := fmt.Sprintf("%v", cs.Retry()), "&{{100000000 60000000000 1.3 0} [10 1 13 8 2 14 4]}"; got != want {
58-
t.Fatalf("got: %v, want: %v", got, want)
59-
}
60-
61-
// This is the custom retry setting.
62-
c.pubc.CallOptions.Publish[2].Resolve(cs)
63-
if got, want := fmt.Sprintf("%v", cs.Retry()), "&{{200000000 30000000000 1.25 0} [14 4]}"; got != want {
64-
t.Fatalf("merged CallOptions is incorrect: got %v, want %v", got, want)
65-
}
66-
}
67-
6832
func TestClient_ApplyClientConfig(t *testing.T) {
6933
ctx := context.Background()
7034
srv := pstest.NewServer()

0 commit comments

Comments
 (0)