aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-07-31 15:38:37 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-07-31 15:38:37 -0700
commit7c1be05463d8122e996d45fffb27d3c87170e500 (patch)
treeebd129eb722468e3a5ee40d8c5ea7c2d707564ff /test/cpp/end2end
parent4719ad01d5fabdbbc0034b2ea32a60b4c90b34bb (diff)
Line up starting times
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r--test/cpp/end2end/end2end_test.cc10
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());