Skip to content

Commit f8aa219

Browse files
authored
test(storage): deflake benchmark integration test (#6898)
1 parent 4d949a7 commit f8aa219

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

google/cloud/storage/benchmarks/throughput_experiment_test.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ namespace cloud {
2323
namespace storage_benchmarks {
2424
namespace {
2525

26+
using ::google::cloud::testing_util::StatusIs;
27+
using ::testing::AnyOf;
28+
2629
class ThroughputExperimentIntegrationTest
2730
: public google::cloud::storage::testing::StorageIntegrationTest,
2831
public ::testing::WithParamInterface<ApiName> {
@@ -64,11 +67,10 @@ TEST_P(ThroughputExperimentIntegrationTest, Upload) {
6467
/*enable_crc32c=*/false,
6568
/*enable_md5=*/false};
6669
auto result = e->Run(bucket_name_, object_name, config);
67-
EXPECT_STATUS_OK(result.status);
68-
if (result.status.ok()) {
69-
auto status = client->DeleteObject(bucket_name_, object_name);
70-
EXPECT_STATUS_OK(status);
71-
}
70+
ASSERT_STATUS_OK(result.status);
71+
auto status = client->DeleteObject(bucket_name_, object_name);
72+
EXPECT_THAT(status,
73+
StatusIs(AnyOf(StatusCode::kOk, StatusCode::kNotFound)));
7274
}
7375
}
7476

@@ -108,7 +110,8 @@ TEST_P(ThroughputExperimentIntegrationTest, Download) {
108110
(void)e->Run(bucket_name_, object_name, config);
109111

110112
auto status = client->DeleteObject(bucket_name_, object_name);
111-
EXPECT_STATUS_OK(status);
113+
EXPECT_THAT(status,
114+
StatusIs(AnyOf(StatusCode::kOk, StatusCode::kNotFound)));
112115
}
113116
}
114117

0 commit comments

Comments
 (0)