Properly count messages sent

pull/23416/head
Vijay Pai 4 years ago
parent 0ab6db4fe8
commit fe2e9d6803
  1. 4
      test/cpp/end2end/test_service_impl.cc

@ -501,19 +501,19 @@ CallbackTestServiceImpl::ResponseStream(
std::to_string(num_msgs_sent_));
if (num_msgs_sent_ == server_responses_to_send_ - 1 &&
server_coalescing_api_ != 0) {
num_msgs_sent_++;
{
std::lock_guard<std::mutex> l(finish_mu_);
if (!finished_) {
num_msgs_sent_++;
StartWriteLast(&response_, WriteOptions());
}
}
// If we use WriteLast, we shouldn't wait before attempting Finish
FinishOnce(Status::OK);
} else {
num_msgs_sent_++;
std::lock_guard<std::mutex> l(finish_mu_);
if (!finished_) {
num_msgs_sent_++;
StartWrite(&response_);
}
}

Loading…
Cancel
Save