Address code review comments

pull/4958/head
Sree Kuchibhotla 9 years ago
parent 3075c81028
commit 369a04ace6
  1. 2
      src/cpp/server/server_context.cc
  2. 3
      test/cpp/end2end/async_end2end_test.cc

@ -177,7 +177,7 @@ void ServerContext::TryCancel() const {
grpc_call_error err = grpc_call_cancel_with_status( grpc_call_error err = grpc_call_cancel_with_status(
call_, GRPC_STATUS_CANCELLED, "Cancelled on the server side", NULL); call_, GRPC_STATUS_CANCELLED, "Cancelled on the server side", NULL);
if (err != GRPC_CALL_OK) { if (err != GRPC_CALL_OK) {
gpr_log(GPR_INFO, "TryCancel failed with: %d", err); gpr_log(GPR_ERROR, "TryCancel failed with: %d", err);
} }
} }

@ -884,13 +884,12 @@ class AsyncEnd2endServerTryCancelTest : public AsyncEnd2endTest {
// Server sends the final message and cancelled status (but the RPC is // Server sends the final message and cancelled status (but the RPC is
// already cancelled at this point. So we expect the operation to fail) // already cancelled at this point. So we expect the operation to fail)
send_response.set_message("Pong");
srv_stream.Finish(send_response, Status::CANCELLED, tag(9)); srv_stream.Finish(send_response, Status::CANCELLED, tag(9));
Verifier(GetParam()).Expect(9, false).Verify(cq_.get()); Verifier(GetParam()).Expect(9, false).Verify(cq_.get());
// Client will see the cancellation // Client will see the cancellation
cli_stream->Finish(&recv_status, tag(10)); cli_stream->Finish(&recv_status, tag(10));
// TODO: sreek: The expectation here should be true. This is a bug (github // TODO(sreek): The expectation here should be true. This is a bug (github
// issue #4972) // issue #4972)
Verifier(GetParam()).Expect(10, false).Verify(cq_.get()); Verifier(GetParam()).Expect(10, false).Verify(cq_.get());
EXPECT_FALSE(recv_status.ok()); EXPECT_FALSE(recv_status.ok());

Loading…
Cancel
Save