Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jasdel committed May 1, 2015
1 parent 7f3e9aa commit 3878080
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions service/s3/s3manager/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import (
"github.com/stretchr/testify/assert"
)

var buf12MB = bytes.NewBuffer(make([]byte, 1024*1024*20))

This comment has been minimized.

Copy link
@lsegal

lsegal May 1, 2015

Contributor

Looks like buf12MB is no longer defined?

This comment has been minimized.

Copy link
@jasdel

jasdel May 1, 2015

Author Contributor

Defined in upload_test.go actually, running integration tests caused an "already defined error". This change just causes integration_test.go to use the var defined by upload_test.go.

Alternatively Could just rename the integration_test.go buf12MB to something else like integBuf12MB. What do you think?

var md512MB = fmt.Sprintf("%x", md5.Sum(buf12MB.Bytes()))
var md512MB = fmt.Sprintf("%x", md5.Sum(buf12MB))

var bucketName *string

Expand Down Expand Up @@ -80,7 +79,7 @@ func TestUploadConcurrently(t *testing.T) {
out, err := s3manager.Upload(svc, &s3manager.UploadInput{
Bucket: bucketName,
Key: &key,
Body: bytes.NewReader(buf12MB.Bytes()),
Body: bytes.NewReader(buf12MB),
}, nil)

assert.NoError(t, err)
Expand Down Expand Up @@ -108,7 +107,7 @@ func TestUploadFailCleanup(t *testing.T) {
u, err := s3manager.Upload(svc, &s3manager.UploadInput{
Bucket: bucketName,
Key: &key,
Body: bytes.NewReader(buf12MB.Bytes()),
Body: bytes.NewReader(buf12MB),
}, &s3manager.UploadOptions{
LeavePartsOnError: false,
})
Expand Down

0 comments on commit 3878080

Please sign in to comment.