Skip to content

Commit b5d8bef

Browse files
authored
fix(storage): deflake IAM integration test (#6234)
1 parent 348a58a commit b5d8bef

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

google/cloud/storage/tests/bucket_integration_test.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ using ::google::cloud::storage::testing::AclEntityNames;
3636
using ::google::cloud::testing_util::ContainsOnce;
3737
using ::google::cloud::testing_util::IsOk;
3838
using ::testing::Contains;
39-
using ::testing::ElementsAreArray;
4039
using ::testing::HasSubstr;
4140
using ::testing::Not;
41+
using ::testing::UnorderedElementsAreArray;
4242

4343
class BucketIntegrationTest
4444
: public google::cloud::storage::testing::StorageIntegrationTest {
@@ -724,7 +724,8 @@ TEST_F(BucketIntegrationTest, IamCRUD) {
724724
StatusOr<std::vector<std::string>> actual_permissions =
725725
client->TestBucketIamPermissions(bucket_name, expected_permissions);
726726
ASSERT_STATUS_OK(actual_permissions);
727-
EXPECT_THAT(*actual_permissions, ElementsAreArray(expected_permissions));
727+
EXPECT_THAT(*actual_permissions,
728+
UnorderedElementsAreArray(expected_permissions));
728729

729730
auto status = client->DeleteBucket(bucket_name);
730731
ASSERT_STATUS_OK(status);
@@ -799,7 +800,8 @@ TEST_F(BucketIntegrationTest, NativeIamCRUD) {
799800
StatusOr<std::vector<std::string>> actual_permissions =
800801
client->TestBucketIamPermissions(bucket_name, expected_permissions);
801802
ASSERT_STATUS_OK(actual_permissions);
802-
EXPECT_THAT(*actual_permissions, ElementsAreArray(expected_permissions));
803+
EXPECT_THAT(*actual_permissions,
804+
UnorderedElementsAreArray(expected_permissions));
803805

804806
auto status = client->DeleteBucket(bucket_name);
805807
ASSERT_STATUS_OK(status);
@@ -1156,7 +1158,8 @@ TEST_F(BucketIntegrationTest, NativeIamWithRequestedPolicyVersion) {
11561158
StatusOr<std::vector<std::string>> actual_permissions =
11571159
client->TestBucketIamPermissions(bucket_name, expected_permissions);
11581160
ASSERT_STATUS_OK(actual_permissions);
1159-
EXPECT_THAT(*actual_permissions, ElementsAreArray(expected_permissions));
1161+
EXPECT_THAT(*actual_permissions,
1162+
UnorderedElementsAreArray(expected_permissions));
11601163

11611164
auto status = client->DeleteBucket(bucket_name);
11621165
ASSERT_STATUS_OK(status);

0 commit comments

Comments
 (0)