aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end
diff options
context:
space:
mode:
authorGravatar kpayson64 <kpayson@google.com>2018-05-23 09:38:00 -0700
committerGravatar kpayson64 <kpayson@google.com>2018-05-23 09:38:00 -0700
commite169f20cd0330484339795685417abc962edf5d2 (patch)
tree72414e8ddb60d3de6652509040c8e1f27c4dc320 /test/cpp/end2end
parentc0a89c71ff7a64aa967a2e4f437eecf0b69af5e7 (diff)
Add more failure logging to client_lb_end2end_test
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r--test/cpp/end2end/client_lb_end2end_test.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc
index a39e443cf0..9a0f6b6c2d 100644
--- a/test/cpp/end2end/client_lb_end2end_test.cc
+++ b/test/cpp/end2end/client_lb_end2end_test.cc
@@ -198,7 +198,8 @@ class ClientLbEnd2endTest : public ::testing::Test {
bool SendRpc(
const std::unique_ptr<grpc::testing::EchoTestService::Stub>& stub,
- EchoResponse* response = nullptr, int timeout_ms = 1000) {
+ EchoResponse* response = nullptr, int timeout_ms = 1000,
+ Status* result = nullptr) {
const bool local_response = (response == nullptr);
if (local_response) response = new EchoResponse;
EchoRequest request;
@@ -206,6 +207,7 @@ class ClientLbEnd2endTest : public ::testing::Test {
ClientContext context;
context.set_deadline(grpc_timeout_milliseconds_to_deadline(timeout_ms));
Status status = stub->Echo(&context, request, response);
+ if (result != nullptr) *result = status;
if (local_response) delete response;
return status.ok();
}
@@ -214,12 +216,15 @@ class ClientLbEnd2endTest : public ::testing::Test {
const std::unique_ptr<grpc::testing::EchoTestService::Stub>& stub,
const grpc_core::DebugLocation& location) {
EchoResponse response;
- const bool success = SendRpc(stub, &response);
- if (!success) abort();
- ASSERT_TRUE(success) << "From " << location.file() << ":"
- << location.line();
+ Status status;
+ const bool success = SendRpc(stub, &response, 2000, &status);
+ ASSERT_TRUE(success) << "From " << location.file() << ":" << location.line()
+ << "\n"
+ << "Error: " << status.error_message() << " "
+ << status.error_details();
ASSERT_EQ(response.message(), kRequestMessage_)
<< "From " << location.file() << ":" << location.line();
+ if (!success) abort();
}
void CheckRpcSendFailure(