|
|
|
@ -76,11 +76,11 @@ void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { |
|
|
|
|
EXPECT_EQ(tag(i), got_tag); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void verify_timed_ok(CompletionQueue* cq, int i, bool expect_ok, |
|
|
|
|
void verify_timed_ok( |
|
|
|
|
CompletionQueue* cq, int i, bool expect_ok, |
|
|
|
|
std::chrono::system_clock::time_point deadline = |
|
|
|
|
std::chrono::system_clock::time_point::max(), |
|
|
|
|
CompletionQueue::NextStatus expected_outcome = |
|
|
|
|
CompletionQueue::GOT_EVENT) { |
|
|
|
|
CompletionQueue::NextStatus expected_outcome = CompletionQueue::GOT_EVENT) { |
|
|
|
|
bool ok; |
|
|
|
|
void* got_tag; |
|
|
|
|
EXPECT_EQ(cq->AsyncNext(&got_tag, &ok, deadline), expected_outcome); |
|
|
|
@ -195,12 +195,11 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) { |
|
|
|
|
grpc::ServerAsyncResponseWriter<EchoResponse> response_writer(&srv_ctx); |
|
|
|
|
|
|
|
|
|
send_request.set_message("Hello"); |
|
|
|
|
std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > |
|
|
|
|
response_reader(stub_->AsyncEcho(&cli_ctx, send_request, |
|
|
|
|
&cli_cq_, tag(1))); |
|
|
|
|
std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader( |
|
|
|
|
stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); |
|
|
|
|
|
|
|
|
|
std::chrono::system_clock::time_point |
|
|
|
|
time_now(std::chrono::system_clock::now()), |
|
|
|
|
std::chrono::system_clock::time_point time_now( |
|
|
|
|
std::chrono::system_clock::now()), |
|
|
|
|
time_limit(std::chrono::system_clock::now() + std::chrono::seconds(5)); |
|
|
|
|
verify_timed_ok(&srv_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); |
|
|
|
|
verify_timed_ok(&cli_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); |
|
|
|
@ -221,7 +220,6 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) { |
|
|
|
|
|
|
|
|
|
EXPECT_EQ(send_response.message(), recv_response.message()); |
|
|
|
|
EXPECT_TRUE(recv_status.IsOk()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Two pings and a final pong.
|
|
|
|
|