Skip to content

Commit

Permalink
Deflake integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan committed Jul 25, 2024
1 parent 0f0f152 commit a3131d2
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions google/cloud/storage/tests/async_client_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "google/cloud/storage/async/idempotency_policy.h"
#include "google/cloud/storage/grpc_plugin.h"
#include "google/cloud/storage/testing/storage_integration_test.h"
#include "google/cloud/grpc_options.h"
#include "google/cloud/internal/getenv.h"
#include "google/cloud/testing_util/is_proto_equal.h"
#include "google/cloud/testing_util/status_matchers.h"
Expand Down Expand Up @@ -71,7 +72,9 @@ class AsyncClientIntegrationTest

auto TestOptions() {
// Disable metrics in the test, they just make the logs harder to grok.
return Options{}.set<storage_experimental::EnableGrpcMetricsOption>(false);
return Options{}
.set<storage_experimental::EnableGrpcMetricsOption>(false)
.set<GrpcNumChannelsOption>(1);
}

auto AlwaysRetry() {
Expand Down Expand Up @@ -195,9 +198,10 @@ TEST_F(AsyncClientIntegrationTest, StreamingRead) {
insert_data.begin(), insert_data.end(), static_cast<std::size_t>(0),
[](auto a, auto const& b) { return a + b.size(); });

auto insert =
async.InsertObject(BucketName(bucket_name()), object_name, insert_data)
.get();
auto insert = async
.InsertObject(BucketName(bucket_name()), object_name,
insert_data, AlwaysRetry())
.get();
ASSERT_STATUS_OK(insert);
ScheduleForDelete(*insert);

Expand Down Expand Up @@ -240,9 +244,10 @@ TEST_F(AsyncClientIntegrationTest, StreamingReadRange) {
for (int i = 0; i != kLineCount; ++i) contents += block;
auto const expected_insert_size = contents.size();

auto insert =
async.InsertObject(BucketName(bucket_name()), object_name, contents)
.get();
auto insert = async
.InsertObject(BucketName(bucket_name()), object_name,
contents, AlwaysRetry())
.get();
ASSERT_STATUS_OK(insert);
ScheduleForDelete(*insert);

Expand Down

0 comments on commit a3131d2

Please sign in to comment.