The Writes may return false after the server cancels the stream

pull/3627/head
yang-g 10 years ago
parent 2c1c00055b
commit c04610357c
  1. 6
      test/cpp/end2end/end2end_test.cc

@ -683,10 +683,14 @@ TEST_P(End2endTest, RequestStreamServerEarlyCancelTest) {
auto stream = stub_->RequestStream(&context, &response);
request.set_message("hello");
int send_messages = 20;
while (send_messages > 0) {
while (send_messages > 10) {
EXPECT_TRUE(stream->Write(request));
send_messages--;
}
while (send_messages > 0) {
stream->Write(request);
send_messages--;
}
stream->WritesDone();
Status s = stream->Finish();
EXPECT_EQ(s.error_code(), StatusCode::CANCELLED);

Loading…
Cancel
Save