Skip to content

Commit

Permalink
fix uint testing data overflow bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianyi Wang committed Feb 15, 2023
1 parent 1f9c50e commit 996b879
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aws/retry/jitter_backoff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestExponentialJitterBackoff_AttemptDelay(t *testing.T) {
"max delay": {
MaxBackoff: 20 * time.Second,
RandFloat: func() (float64, error) { return maxB, nil },
Attempt: 1 << 53,
Attempt: math.MaxInt,
Expect: timeconv.FloatSecondsDur(maxB * math.Exp2(math.Log2(20))),
},
}
Expand Down
10 changes: 5 additions & 5 deletions service/internal/benchmark/dynamodb/customizations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (

type testData struct {
filename string
respChecksum int
respGzipChecksum int
respChecksum int64
respGzipChecksum int64
}

func BenchmarkCustomizations(b *testing.B) {
Expand Down Expand Up @@ -71,7 +71,7 @@ func benchCustomizationsOld(b *testing.B, c testData) {
r.HTTPResponse = &http.Response{
StatusCode: 200,
Header: http.Header{
"X-Amz-Crc32": []string{strconv.Itoa(c.respChecksum)},
"X-Amz-Crc32": []string{strconv.FormatInt(c.respChecksum, 10)},
},
ContentLength: int64(len(body)),
Body: ioutil.NopCloser(bytes.NewReader(body)),
Expand Down Expand Up @@ -127,7 +127,7 @@ func benchCustomizationsSmithy(b *testing.B, c testData) {
Region: "us-west-2",
Credentials: unit.StubCredentialsProvider{},
HTTPClient: &mockClient{
ChecksumHeaderValue: []string{strconv.Itoa(c.respChecksum)},
ChecksumHeaderValue: []string{strconv.FormatInt(c.respChecksum, 10)},
ScanRespBody: body,
},
}
Expand All @@ -141,7 +141,7 @@ func benchCustomizationsSmithy(b *testing.B, c testData) {
b.Run("all enabled", func(b *testing.B) {
client := dynamodb.New(options, func(o *dynamodb.Options) {
o.HTTPClient = &mockClient{
ChecksumHeaderValue: []string{strconv.Itoa(c.respGzipChecksum)},
ChecksumHeaderValue: []string{strconv.FormatInt(c.respGzipChecksum, 10)},
ScanRespGzipBody: gzipBody,
}
o.DisableValidateResponseChecksum = false
Expand Down

0 comments on commit 996b879

Please sign in to comment.