Skip to content

Commit cf921ad

Browse files
committed
build: reduce test execution time
1 parent 94aeffb commit cf921ad

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

retry_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ func TestClientRetryWait(t *testing.T) {
219219
retryIntervals := make([]uint64, retryCount+1)
220220

221221
// Set retry wait times that do not intersect with default ones
222-
retryWaitTime := time.Duration(3) * time.Second
223-
retryMaxWaitTime := time.Duration(9) * time.Second
222+
retryWaitTime := time.Duration(50) * time.Millisecond
223+
retryMaxWaitTime := time.Duration(150) * time.Millisecond
224224

225225
c := dc().
226226
SetRetryCount(retryCount).
@@ -262,7 +262,7 @@ func TestClientRetryWaitMaxInfinite(t *testing.T) {
262262
retryIntervals := make([]uint64, retryCount+1)
263263

264264
// Set retry wait times that do not intersect with default ones
265-
retryWaitTime := time.Duration(3) * time.Second
265+
retryWaitTime := time.Duration(100) * time.Millisecond
266266
retryMaxWaitTime := time.Duration(-1.0) // negative value
267267

268268
c := dc().
@@ -319,8 +319,8 @@ func TestClientRetryWaitCallbackError(t *testing.T) {
319319
retryIntervals := make([]uint64, retryCount+1)
320320

321321
// Set retry wait times that do not intersect with default ones
322-
retryWaitTime := 3 * time.Second
323-
retryMaxWaitTime := 9 * time.Second
322+
retryWaitTime := 50 * time.Millisecond
323+
retryMaxWaitTime := 150 * time.Millisecond
324324

325325
retryAfter := func(client *Client, resp *Response) (time.Duration, error) {
326326
return 0, errors.New("quota exceeded")
@@ -359,11 +359,11 @@ func TestClientRetryWaitCallback(t *testing.T) {
359359
retryIntervals := make([]uint64, retryCount+1)
360360

361361
// Set retry wait times that do not intersect with default ones
362-
retryWaitTime := 3 * time.Second
363-
retryMaxWaitTime := 9 * time.Second
362+
retryWaitTime := 50 * time.Millisecond
363+
retryMaxWaitTime := 150 * time.Millisecond
364364

365365
retryAfter := func(client *Client, resp *Response) (time.Duration, error) {
366-
return 5 * time.Second, nil
366+
return 50 * time.Millisecond, nil
367367
}
368368

369369
c := dc().
@@ -407,11 +407,11 @@ func TestClientRetryWaitCallbackTooShort(t *testing.T) {
407407
retryIntervals := make([]uint64, retryCount+1)
408408

409409
// Set retry wait times that do not intersect with default ones
410-
retryWaitTime := 3 * time.Second
411-
retryMaxWaitTime := 9 * time.Second
410+
retryWaitTime := 50 * time.Millisecond
411+
retryMaxWaitTime := 150 * time.Millisecond
412412

413413
retryAfter := func(client *Client, resp *Response) (time.Duration, error) {
414-
return 2 * time.Second, nil // too short duration
414+
return 10 * time.Millisecond, nil // too short duration
415415
}
416416

417417
c := dc().
@@ -455,11 +455,11 @@ func TestClientRetryWaitCallbackTooLong(t *testing.T) {
455455
retryIntervals := make([]uint64, retryCount+1)
456456

457457
// Set retry wait times that do not intersect with default ones
458-
retryWaitTime := 1 * time.Second
459-
retryMaxWaitTime := 3 * time.Second
458+
retryWaitTime := 10 * time.Millisecond
459+
retryMaxWaitTime := 100 * time.Millisecond
460460

461461
retryAfter := func(client *Client, resp *Response) (time.Duration, error) {
462-
return 4 * time.Second, nil // too long duration
462+
return 150 * time.Millisecond, nil // too long duration
463463
}
464464

465465
c := dc().

0 commit comments

Comments
 (0)