diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 141e084..334c77f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: uses: GeoNet/Actions/.github/workflows/reusable-go-apps.yml@main with: testSetup: | - docker run --name localstack -d --rm -p 4566:4566 -p 4510-4559:4510-4559 docker.io/localstack/localstack:4.0.3 + docker run --name localstack -d --rm -p 4566:4566 -p 4510-4559:4510-4559 docker.io/localstack/localstack:4.10.0 echo "waiting for localstack to be ready" until curl -v localhost:4566; do sleep 1s diff --git a/aws/README.md b/aws/README.md index 38eaab2..f1f0168 100644 --- a/aws/README.md +++ b/aws/README.md @@ -1,3 +1,4 @@ ## Wrapper files for AWS-SDK-GO ## -These files are to simplify how applications interact with the AWS SDK for Go. \ No newline at end of file +These files are to simplify how applications interact with the AWS SDK for Go. +The functions are expected to be in line with the underlying AWS service. diff --git a/aws/sqs/sqs.go b/aws/sqs/sqs.go index cc10211..ca7eba4 100644 --- a/aws/sqs/sqs.go +++ b/aws/sqs/sqs.go @@ -353,7 +353,7 @@ func (s *SQS) SendNBatch(ctx context.Context, queueURL string, bodies []string) const ( maxCount = 10 - maxSize = 262144 // 256 KiB + maxSize = 1048576 // 1 MiB ) allErrors := make([]error, 0) diff --git a/aws/sqs/sqs_integration_test.go b/aws/sqs/sqs_integration_test.go index 90e13f3..59e2734 100644 --- a/aws/sqs/sqs_integration_test.go +++ b/aws/sqs/sqs_integration_test.go @@ -455,11 +455,8 @@ func TestSendBatch(t *testing.T) { require.Nil(t, err, fmt.Sprintf("error creating sqs client: %v", err)) // ACTION - var maxBytes int = 262144 - maxSizeSingleMessage := "" - for range maxBytes { - maxSizeSingleMessage += "a" - } + var maxBytes int = 1048576 + maxSizeSingleMessage := strings.Repeat("a", maxBytes) err = client.SendBatch(context.TODO(), awsCmdQueueURL(), []string{maxSizeSingleMessage}) // ASSERT @@ -474,11 +471,8 @@ func TestSendBatch(t *testing.T) { assert.NotNil(t, err) // ACTION - var maxHalfBytes int = 131072 - maxHalfSizeMessage := "" - for range maxHalfBytes { - maxHalfSizeMessage += "a" - } + var maxHalfBytes int = 524288 + maxHalfSizeMessage := strings.Repeat("a", maxHalfBytes) err = client.SendBatch(context.TODO(), awsCmdQueueURL(), []string{maxHalfSizeMessage, maxHalfSizeMessage}) // ASSERT @@ -531,11 +525,8 @@ func TestSendNBatch(t *testing.T) { require.Nil(t, err, fmt.Sprintf("error creating sqs client: %v", err)) // ACTION - var maxBytes int = 262144 - maxSizeSingleMessage := "" - for range maxBytes { - maxSizeSingleMessage += "a" - } + var maxBytes int = 1048576 + maxSizeSingleMessage := strings.Repeat("a", maxBytes) batchesSent, err := client.SendNBatch(context.TODO(), awsCmdQueueURL(), []string{maxSizeSingleMessage, maxSizeSingleMessage}) // ASSERT