@@ -16,7 +16,6 @@ package pubsub
16
16
17
17
import (
18
18
"context"
19
- "fmt"
20
19
"testing"
21
20
"time"
22
21
@@ -30,41 +29,6 @@ import (
30
29
"google.golang.org/grpc/status"
31
30
)
32
31
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
-
68
32
func TestClient_ApplyClientConfig (t * testing.T ) {
69
33
ctx := context .Background ()
70
34
srv := pstest .NewServer ()
0 commit comments