Skip to content

Commit

Permalink
Merge pull request #178 from microsoft/user/corbinphipps/address-revi…
Browse files Browse the repository at this point in the history
…ew-comments-2

Address review comments
  • Loading branch information
corbin-phipps authored Feb 27, 2024
2 parents 1fb4563 + 2f73c40 commit ae27ad0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 0 additions & 2 deletions protocol/protos/NetRemoteDataStream.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ syntax = "proto3";

package Microsoft.Net.Remote.DataStream;

import "google/protobuf/any.proto";

enum DataStreamOperationStatusCode
{
DataStreamOperationStatusCodeUnknown = 0;
Expand Down
11 changes: 9 additions & 2 deletions tests/unit/TestNetRemoteDataStreamingReactors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,18 @@ grpc::Status
DataStreamWriter::Await(DataStreamUploadResult* result)
{
std::unique_lock lock(m_writeStatusGate);
static constexpr auto timeoutValue = std::chrono::seconds(10);
static constexpr auto timeoutValue = 10s;

m_writesDone.wait_for(lock, timeoutValue, [this] {
const auto isDone = m_writesDone.wait_for(lock, timeoutValue, [this] {
return m_done;
});

if (!isDone) {
DataStreamOperationStatus status{};
status.set_code(DataStreamOperationStatusCode::DataStreamOperationStatusCodeFailed);
status.set_message("Timeout occurred while waiting for all writes to be completed");
*m_result.mutable_status() = std::move(status);
}
*result = m_result;

return m_status;
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/TestNetRemoteDataStreamingServiceClient.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,9 @@ TEST_CASE("DataStreamUpload API", "[basic][rpc][client][remote][stream]")
REQUIRE(result.status().code() == DataStreamOperationStatusCodeSucceeded);
});
}

for (auto& clientThread : clientThreads) {
REQUIRE_NOTHROW(clientThread.join());
}
}
}

0 comments on commit ae27ad0

Please sign in to comment.