Merge branch 'master' of https://github.com/grpc/grpc into import

pull/10621/head
Nicolas "Pixel" Noble 8 years ago
commit 232e9b458b
  1. 1
      src/cpp/server/server_cc.cc
  2. 2
      src/csharp/Grpc.Core/Version.csproj.include
  3. 2
      templates/src/csharp/Grpc.Core/Version.csproj.include.template
  4. 21
      test/cpp/end2end/generic_end2end_test.cc

@ -686,6 +686,7 @@ bool ServerInterface::GenericAsyncRequest::FinalizeResult(void** tag,
StringFromCopiedSlice(call_details_.method);
static_cast<GenericServerContext*>(context_)->host_ =
StringFromCopiedSlice(call_details_.host);
context_->deadline_ = call_details_.deadline;
}
grpc_slice_unref(call_details_.method);
grpc_slice_unref(call_details_.host);

@ -2,6 +2,6 @@
<Project>
<PropertyGroup>
<GrpcCsharpVersion>1.4.0-dev</GrpcCsharpVersion>
<GoogleProtobufVersion>3.2.0</GoogleProtobufVersion>
<GoogleProtobufVersion>3.3.0</GoogleProtobufVersion>
</PropertyGroup>
</Project>

@ -4,6 +4,6 @@
<Project>
<PropertyGroup>
<GrpcCsharpVersion>${settings.csharp_version}</GrpcCsharpVersion>
<GoogleProtobufVersion>3.2.0</GoogleProtobufVersion>
<GoogleProtobufVersion>3.3.0</GoogleProtobufVersion>
</PropertyGroup>
</Project>

@ -116,6 +116,10 @@ class GenericEnd2endTest : public ::testing::Test {
void client_fail(int i) { verify_ok(&cli_cq_, i, false); }
void SendRpc(int num_rpcs) {
SendRpc(num_rpcs, false, gpr_inf_future(GPR_CLOCK_MONOTONIC));
}
void SendRpc(int num_rpcs, bool check_deadline, gpr_timespec deadline) {
const grpc::string kMethodName("/grpc.cpp.test.util.EchoTestService/Echo");
for (int i = 0; i < num_rpcs; i++) {
EchoRequest send_request;
@ -130,6 +134,11 @@ class GenericEnd2endTest : public ::testing::Test {
// The string needs to be long enough to test heap-based slice.
send_request.set_message("Hello world. Hello world. Hello world.");
if (check_deadline) {
cli_ctx.set_deadline(deadline);
}
std::unique_ptr<GenericClientAsyncReaderWriter> call =
generic_stub_->Call(&cli_ctx, kMethodName, &cli_cq_, tag(1));
client_ok(1);
@ -148,6 +157,12 @@ class GenericEnd2endTest : public ::testing::Test {
verify_ok(srv_cq_.get(), 4, true);
EXPECT_EQ(server_host_, srv_ctx.host().substr(0, server_host_.length()));
EXPECT_EQ(kMethodName, srv_ctx.method());
if (check_deadline) {
EXPECT_TRUE(gpr_time_similar(deadline, srv_ctx.raw_deadline(),
gpr_time_from_millis(100, GPR_TIMESPAN)));
}
ByteBuffer recv_buffer;
stream.Read(&recv_buffer, tag(5));
server_ok(5);
@ -263,6 +278,12 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) {
EXPECT_TRUE(recv_status.ok());
}
TEST_F(GenericEnd2endTest, Deadline) {
ResetStub();
SendRpc(1, true, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
gpr_time_from_seconds(10, GPR_TIMESPAN)));
}
} // namespace
} // namespace testing
} // namespace grpc

Loading…
Cancel
Save