diff options
author | Craig Tiller <ctiller@google.com> | 2015-07-31 15:38:37 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-07-31 15:38:37 -0700 |
commit | 7c1be05463d8122e996d45fffb27d3c87170e500 (patch) | |
tree | ebd129eb722468e3a5ee40d8c5ea7c2d707564ff /test/cpp/end2end | |
parent | 4719ad01d5fabdbbc0034b2ea32a60b4c90b34bb (diff) |
Line up starting times
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index f6e55f3cba..32f43610f3 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -278,6 +278,7 @@ class End2endTest : public ::testing::Test { DynamicThreadPool thread_pool_; }; +#if 0 static void SendRpc(grpc::cpp::test::util::TestService::Stub* stub, int num_rpcs) { EchoRequest request; @@ -817,10 +818,12 @@ TEST_F(End2endTest, HugeResponse) { EXPECT_EQ(kResponseSize, response.message().size()); EXPECT_TRUE(s.ok()); } +#endif namespace { -void ReaderThreadFunc(ClientReaderWriter<EchoRequest, EchoResponse>* stream) { +void ReaderThreadFunc(ClientReaderWriter<EchoRequest, EchoResponse>* stream, gpr_event *ev) { EchoResponse resp; + gpr_event_set(ev, (void*)1); while (stream->Read(&resp)) { gpr_log(GPR_INFO, "Read message"); } @@ -831,8 +834,11 @@ void ReaderThreadFunc(ClientReaderWriter<EchoRequest, EchoResponse>* stream) { TEST_F(End2endTest, SimuReadWritesDone) { ResetStub(); ClientContext context; + gpr_event ev; + gpr_event_init(&ev); auto stream = stub_->BidiStream(&context); - std::thread reader_thread(ReaderThreadFunc, stream.get()); + std::thread reader_thread(ReaderThreadFunc, stream.get(), &ev); + gpr_event_wait(&ev, gpr_inf_future(GPR_CLOCK_REALTIME)); stream->WritesDone(); Status s = stream->Finish(); EXPECT_TRUE(s.ok()); |