Skip to content

Commit

Permalink
fix and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinming-Hu committed May 30, 2024
1 parent 803dcd2 commit 7ffedf6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2155,4 +2155,17 @@ namespace Azure { namespace Storage { namespace Test {
= Blobs::BlockBlobClient(m_blockBlobClient->GetUrl(), keyCredential, clientOptions);
EXPECT_NO_THROW(blockBlobClient.GetProperties());
}

TEST_F(BlockBlobClientTest, SyncCopyFromUriWithRetry_PLAYBACKONLY_)
{
auto sourceBlobClient = m_blobContainerClient->GetBlockBlobClient("source" + RandomString());
sourceBlobClient.UploadFrom(m_blobContent.data(), m_blobContent.size());

const std::string blobName = "dest" + RandomString();
auto destBlobClient = m_blobContainerClient->GetBlockBlobClient(blobName);

auto res = destBlobClient.CopyFromUri(sourceBlobClient.GetUrl() + GetSas());
EXPECT_EQ(res.RawResponse->GetStatusCode(), Azure::Core::Http::HttpStatusCode::Accepted);
}

}}} // namespace Azure::Storage::Test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ namespace Azure { namespace Storage { namespace _internal {
}
~StorageRetryPolicy() override {}

std::unique_ptr<HttpPolicy> Clone() const override
{
return std::make_unique<StorageRetryPolicy>(*this);
}

protected:
bool ShouldRetry(
const std::unique_ptr<Core::Http::RawResponse>& response,
Expand Down

0 comments on commit 7ffedf6

Please sign in to comment.