From bdfec2c86ceba99e6cc3e58ee256dffe1632aaf4 Mon Sep 17 00:00:00 2001
From: Vijay Pai <vpai@google.com>
Date: Thu, 25 Feb 2016 11:51:21 -0800
Subject: [PATCH] SimultaneousReadWritesDone test was not observing the
 contract on the streaming API. In particular, Finish should not be called
 until the client is sure that there is no more message to be read (as
 documented in the comments for ClientStreamingInterface::Finish)

---
 test/cpp/end2end/end2end_test.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index ce8e4d2a10..42757974b2 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -904,9 +904,9 @@ TEST_P(End2endTest, SimultaneousReadWritesDone) {
   std::thread reader_thread(ReaderThreadFunc, stream.get(), &ev);
   gpr_event_wait(&ev, gpr_inf_future(GPR_CLOCK_REALTIME));
   stream->WritesDone();
+  reader_thread.join();
   Status s = stream->Finish();
   EXPECT_TRUE(s.ok());
-  reader_thread.join();
 }
 
 TEST_P(End2endTest, ChannelState) {
-- 
GitLab