@@ -77,84 +77,3 @@ func TestSleep(t *testing.T) {
7777 t .Fatalf ("err must be nil, but %T" , err )
7878 }
7979}
80-
81- //func TestRetryThrottleCodes(t *testing.T) {
82- //
83- // req := request.Request{}
84- // retryer := DaxRetryer{}
85- // attempt := 2
86- // req.RetryCount = attempt
87- // baseThrottleDelay := 70 * time.Millisecond
88- // //for throttling exception
89- // req.Error = newDaxRequestFailure([]int{0}, "ThrottlingException", "", "", 400)
90- //
91- // if !retryer.ShouldRetry(&req) {
92- // t.Errorf("expected retry on throttling")
93- // }
94- // delay := retryer.RetryRules(&req)
95- // maxDelay := time.Duration(1<<uint64(attempt)) * baseThrottleDelay
96- // if delay > maxDelay {
97- // t.Errorf("delay more than expected, expected upto %d, got %d ", maxDelay, delay)
98- // }
99- // if delay <= 0 {
100- // t.Errorf("delay for throttled error should be greater than 0, got %d", delay)
101- // }
102- //
103- // //for non throttling exception
104- // req.Error = newDaxRequestFailure([]int{0}, "AccessDeniedException", "", "", 400)
105- // if retryer.ShouldRetry(&req) || retryer.RetryRules(&req) != 0 {
106- // t.Errorf("no retry expected")
107- // }
108- //}
109- //
110- //func TestRetryOnThrottlingException(t *testing.T) {
111- // cluster, _ := newTestCluster([]string{"127.0.0.1:8111"})
112- // cluster.update([]serviceEndpoint{{hostname: "localhost", port: 8121}})
113- // cc := ClusterDaxClient{config: DefaultConfig(), cluster: cluster}
114- //
115- // flag := 0
116- // action := func(client DaxAPI, o RequestOptions) error {
117- // if flag == 0 {
118- // flag = 1
119- // return newDaxRequestFailure([]int{0}, "ThrottlingException", "", "", 400)
120- // }
121- // return nil
122- // }
123- //
124- // opt := RequestOptions{
125- // MaxRetries: 2,
126- // }
127- //
128- // err := cc.retry("op", action, opt)
129- //
130- // if err != nil {
131- // t.Errorf("error %v", err)
132- // }
133- //}
134- //
135- //func TestRetryOnAuthenticationRequiredException(t *testing.T) {
136- // cluster, _ := newTestCluster([]string{"127.0.0.1:8111"})
137- // cluster.update([]serviceEndpoint{{hostname: "localhost", port: 8121}})
138- // cc := ClusterDaxClient{config: DefaultConfig(), cluster: cluster}
139- //
140- // flag := 0
141- // codes := []int{4, 23, 31, 33}
142- // action := func(client DaxAPI, o RequestOptions) error {
143- // if flag == 0 {
144- // flag = 1
145- // return newDaxRequestFailure(codes, "AuthenticationRequiredException", "", "", 400)
146- // }
147- // return nil
148- // }
149- //
150- // opt := RequestOptions{
151- // MaxRetries: 2,
152- // }
153- //
154- // err := cc.retry("op", action, opt)
155- //
156- // if err != nil {
157- // t.Errorf("error %v", err)
158- // }
159- //
160- //}
0 commit comments