diff options
author | yang-g <yangg@google.com> | 2017-11-07 11:27:02 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2017-11-07 11:27:02 -0800 |
commit | 0b9b7d261071e525630cde6ba35c6b42dedc9eb1 (patch) | |
tree | 69b5e973449844a221061d24fff57e1d0f57b871 | |
parent | c55a4b1ab577c3ef32794c48ca4ae9fe6f810646 (diff) |
Use same cq for client and server
-rw-r--r-- | test/cpp/end2end/generic_end2end_test.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 7f7ed14802..40949e8f3a 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -216,9 +216,10 @@ TEST_F(GenericEnd2endTest, SequentialUnaryRpcs) { std::unique_ptr<ByteBuffer> cli_send_buffer = SerializeToByteBuffer(&send_request); + // Use the same cq as server so that events can be polled in time. std::unique_ptr<GenericClientAsyncResponseReader> call = generic_stub_->PrepareUnaryCall(&cli_ctx, kMethodName, - *cli_send_buffer.get(), &cli_cq_); + *cli_send_buffer.get(), srv_cq_.get()); call->StartCall(); ByteBuffer cli_recv_buffer; call->Finish(&cli_recv_buffer, &recv_status, tag(1)); @@ -226,7 +227,7 @@ TEST_F(GenericEnd2endTest, SequentialUnaryRpcs) { generic_service_.RequestCall(&srv_ctx, &stream, srv_cq_.get(), srv_cq_.get(), tag(4)); - verify_ok(srv_cq_.get(), 4, true); + server_ok(4); EXPECT_EQ(server_host_, srv_ctx.host().substr(0, server_host_.length())); EXPECT_EQ(kMethodName, srv_ctx.method()); @@ -245,7 +246,7 @@ TEST_F(GenericEnd2endTest, SequentialUnaryRpcs) { stream.Finish(Status::OK, tag(7)); server_ok(7); - client_ok(1); + verify_ok(srv_cq_.get(), 1, true); EXPECT_TRUE(ParseFromByteBuffer(&cli_recv_buffer, &recv_response)); EXPECT_EQ(send_response.message(), recv_response.message()); EXPECT_TRUE(recv_status.ok()); |