You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests fail to build on 32-bit due to the assumption that untyped integers are 64-bit.
Expected Behavior
Tests build successfully and pass.
Current Behavior
In main module:
# github.com/aws/aws-sdk-go-v2/aws/retry [github.com/aws/aws-sdk-go-v2/aws/retry.test]
aws/retry/jitter_backoff_test.go:41:16: cannot use 1 << 53 (untyped int constant 9007199254740992) as int value in struct literal (overflows)
And in service/internal/benchmark module:
# github.com/aws/aws-sdk-go-v2/service/internal/benchmark/dynamodb [github.com/aws/aws-sdk-go-v2/service/internal/benchmark/dynamodb.test]
dynamodb/customizations_test.go:41:22: cannot use 4158286593 (untyped int constant) as int value in struct literal (overflows)
dynamodb/customizations_test.go:42:22: cannot use 3095499784 (untyped int constant) as int value in struct literal (overflows)
Reproduction Steps
Run tests for 386 arch:
GOARCH=386 go test ./...
Possible Solution
For the main module, ExponentialJitterBackoff.BackoffDelay takes an unsigned int for the attempt. To avoid breaking an existing API, the test should either use a literal constant which won't overflow on 32-bit, or use platform-specific constants, e.g. Math.MaxInt
For the service/internal/benchmark module, the relevant testData struct members can simply be changed to int64, e.g.
The use of strconv.Itoa in the test would also need to be changed to strconv.FormatInt, since the former takes an untyped int. However, this does beg the question of why larger-than-32-bit test values are being used in the X-Amz-Crc32 header. Is it not a 32-bit checksum?
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
Tests fail to build on 32-bit due to the assumption that untyped integers are 64-bit.
Expected Behavior
Tests build successfully and pass.
Current Behavior
In main module:
And in service/internal/benchmark module:
Reproduction Steps
Run tests for 386 arch:
Possible Solution
For the main module,
ExponentialJitterBackoff.BackoffDelay
takes an unsigned int for the attempt. To avoid breaking an existing API, the test should either use a literal constant which won't overflow on 32-bit, or use platform-specific constants, e.g.Math.MaxInt
For the service/internal/benchmark module, the relevant
testData
struct members can simply be changed to int64, e.g.The use of
strconv.Itoa
in the test would also need to be changed tostrconv.FormatInt
, since the former takes an untyped int. However, this does beg the question of why larger-than-32-bit test values are being used in theX-Amz-Crc32
header. Is it not a 32-bit checksum?Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.19.5 linux/amd64
Operating System and version
Debian sid
The text was updated successfully, but these errors were encountered: