From 175a761dbbb4f8214dde76aaed124e695fd0a69b Mon Sep 17 00:00:00 2001 From: microzchang <110015819+microzchang@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:48:35 +0800 Subject: [PATCH] Storage Fix live test failure (#5836) --- .../test/ut/share_file_client_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp index 505f888c6..47a49c7a1 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp @@ -876,6 +876,8 @@ namespace Azure { namespace Storage { namespace Test { // GetRangeListDiff with Range { + // sleep for 1 second to make sure the previous operation is finished + TestSleep(std::chrono::milliseconds(1000)); auto snapshot = m_shareClient->CreateSnapshot().Value.Snapshot; EXPECT_NO_THROW(fileClient.ClearRange(64, 64)); Files::Shares::GetFileRangeListOptions options; @@ -910,6 +912,8 @@ namespace Azure { namespace Storage { namespace Test { EXPECT_NO_THROW(fileClient.UploadRange(0, memBodyStream)); + // sleep for 1 second to make sure the previous operation is finished + TestSleep(std::chrono::milliseconds(1000)); auto snapshot = m_shareClient->CreateSnapshot().Value.Snapshot; EXPECT_NO_THROW(fileClient.ClearRange(64, 64));