Skip to content

Commit

Permalink
Merge pull request #2026 from aws/firstissue
Browse files Browse the repository at this point in the history
fix #1998 int overflow bug in 32 bit architecture
  • Loading branch information
wty-Bryant authored Feb 20, 2023
2 parents 9af2842 + 1ca1e18 commit 8e6fa27
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .changelog/f4bce07753bc4db9a6e8bf18d0b8ce8b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id": "f4bce077-53bc-4db9-a6e8-bf18d0b8ce8b",
"type": "bugfix",
"description": "fix int overflow bug on 32 bit architecture",
"modules": [
".",
"service/internal/benchmark"
]
}
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: 2147483647,
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 8e6fa27

Please sign in to comment.