Skip to content

Commit 0b4b95f

Browse files
committed
fixing tests
1 parent e5a139a commit 0b4b95f

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

google/cloud/storage/internal/async/connection_impl_open_test.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ TEST(AsyncConnectionImplTest, OpenSimple) {
202202
});
203203

204204
auto mock_cq = std::make_shared<MockCompletionQueueImpl>();
205+
EXPECT_CALL(*mock_cq, MakeRelativeTimer)
206+
.WillRepeatedly([](std::chrono::nanoseconds) {
207+
return make_ready_future(
208+
StatusOr<std::chrono::system_clock::time_point>(
209+
std::chrono::system_clock::now()));
210+
});
205211
auto connection = std::make_shared<AsyncConnectionImpl>(
206212
CompletionQueue(mock_cq), std::shared_ptr<GrpcChannelRefresh>(), mock,
207213
TestOptions());

google/cloud/storage/internal/async/object_descriptor_impl.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ void ObjectDescriptorImpl::MakeSubsequentStream() {
9393
}
9494
// Proactively create a new stream if needed.
9595
AssurePendingStreamQueued();
96+
if (!pending_stream_.valid()) return;
9697
auto stream_future = std::move(pending_stream_);
9798
lk.unlock();
9899

google/cloud/storage/internal/async/object_descriptor_impl_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ TEST(ObjectDescriptorImpl, OnResumeSuccessful) {
15801580
auto e1 = seq.PopFrontWithName();
15811581
auto e2 = seq.PopFrontWithName();
15821582
std::set<std::string> names = {e1.second, e2.second};
1583-
if (names.count("Read[1]") && names.count("ProactiveFactory")) {
1583+
if (names.count("Read[1]") != 0 && names.count("ProactiveFactory") != 0) {
15841584
e1.first.set_value(true); // Allow read to proceed
15851585
e2.first.set_value(true); // Allow factory to proceed
15861586
} else {

0 commit comments

Comments
 (0)