Fix unstable test cases (#6541)

This commit is contained in:
microzchang 2025-04-28 10:42:02 +08:00 committed by GitHub
parent cefaf3a978
commit 8b092ab175
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 5 deletions

View File

@ -588,7 +588,11 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_TRUE(downloadResult.Value.Details.EncryptionContext.HasValue());
EXPECT_EQ(encryptionContext, downloadResult.Value.Details.EncryptionContext.Value());
// Assert DataLakeDirectoryClient::ListPaths
auto paths = directoryClient.ListPaths(false).Paths;
std::vector<Files::DataLake::Models::PathItem> paths;
for (auto page = directoryClient.ListPaths(false); page.HasPage(); page.MoveToNextPage())
{
paths.insert(paths.end(), page.Paths.begin(), page.Paths.end());
}
EXPECT_EQ(paths.size(), 1);
EXPECT_TRUE(paths[0].EncryptionContext.HasValue());
EXPECT_EQ(encryptionContext, paths[0].EncryptionContext.Value());

View File

@ -272,10 +272,14 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_NO_THROW(fileClient.ScheduleDeletion(
Files::DataLake::ScheduleFileExpiryOriginType::Absolute, options));
auto pagedResult = m_fileSystemClient->ListPaths(true);
EXPECT_EQ(1L, pagedResult.Paths.size());
ASSERT_TRUE(pagedResult.Paths[0].ExpiresOn.HasValue());
EXPECT_EQ(options.ExpiresOn.Value(), pagedResult.Paths[0].ExpiresOn.Value());
std::vector<Files::DataLake::Models::PathItem> paths;
for (auto page = m_fileSystemClient->ListPaths(true); page.HasPage(); page.MoveToNextPage())
{
paths.insert(paths.end(), page.Paths.begin(), page.Paths.end());
}
EXPECT_EQ(1L, paths.size());
ASSERT_TRUE(paths[0].ExpiresOn.HasValue());
EXPECT_EQ(options.ExpiresOn.Value(), paths[0].ExpiresOn.Value());
}
TEST_F(DataLakeFileSystemClientTest, UnencodedPathDirectoryFileNameWorks)