Skip to content

Commit cc6fd22

Browse files
authored
Use unique container names for tests TestSetBlobTagsWithLeaseId (Azure#20498)
There are two tests with the same name and depending on timing, the container might not have finished being deleted. Use unique names to avoid the race. Cleaned up linter warnings for error strings.
1 parent 0815ecb commit cc6fd22

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

sdk/storage/azblob/appendblob/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func (ab *Client) SetLegalHold(ctx context.Context, legalHold bool, options *blo
259259
// SetTier
260260
// Deprecated: SetTier only works for page blob in premium storage account and block blob in blob storage account.
261261
func (ab *Client) SetTier(ctx context.Context, tier blob.AccessTier, o *blob.SetTierOptions) (blob.SetTierResponse, error) {
262-
return blob.SetTierResponse{}, errors.New("Operation will not work on this blob type. SetTier only works for page blob in premium storage account and block blob in blob storage account.")
262+
return blob.SetTierResponse{}, errors.New("operation will not work on this blob type. SetTier only works for page blob in premium storage account and block blob in blob storage account")
263263
}
264264

265265
// SetExpiry operation sets an expiry time on an existing blob. This operation is only allowed on Hierarchical Namespace enabled accounts.
@@ -326,7 +326,7 @@ func (ab *Client) GetTags(ctx context.Context, o *blob.GetTagsOptions) (blob.Get
326326
// CopyFromURL
327327
// Deprecated: CopyFromURL works only with block blob
328328
func (ab *Client) CopyFromURL(ctx context.Context, copySource string, o *blob.CopyFromURLOptions) (blob.CopyFromURLResponse, error) {
329-
return blob.CopyFromURLResponse{}, errors.New("Operation will not work on this blob type. CopyFromURL works only with block blob.")
329+
return blob.CopyFromURLResponse{}, errors.New("operation will not work on this blob type. CopyFromURL works only with block blob")
330330
}
331331

332332
// Concurrent Download Functions -----------------------------------------------------------------------------------------

sdk/storage/azblob/appendblob/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"context"
1212
"crypto/md5"
1313
"encoding/binary"
14-
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/lease"
1514
"hash/crc64"
1615
"io"
1716
"math/rand"
@@ -31,6 +30,7 @@ import (
3130
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container"
3231
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/shared"
3332
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/testcommon"
33+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/lease"
3434
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas"
3535
"github.com/stretchr/testify/require"
3636
"github.com/stretchr/testify/suite"
@@ -2918,7 +2918,7 @@ func (s *AppendBlobRecordedTestsSuite) TestAppendBlobSetBlobTags() {
29182918

29192919
func (s *AppendBlobUnrecordedTestsSuite) TestSetBlobTagsWithLeaseId() {
29202920
_require := require.New(s.T())
2921-
testName := s.T().Name()
2921+
testName := "ab" + s.T().Name()
29222922
svcClient, err := testcommon.GetServiceClient(s.T(), testcommon.TestAccountDefault, nil)
29232923
_require.NoError(err)
29242924

sdk/storage/azblob/blockblob/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,7 @@ func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTags() {
22882288

22892289
func (s *BlockBlobUnrecordedTestsSuite) TestSetBlobTagsWithLeaseId() {
22902290
_require := require.New(s.T())
2291-
testName := s.T().Name()
2291+
testName := "bb" + s.T().Name()
22922292
svcClient, err := testcommon.GetServiceClient(s.T(), testcommon.TestAccountDefault, nil)
22932293
_require.NoError(err)
22942294

0 commit comments

Comments
 (0)