diff options
author | 2018-05-23 11:10:07 -0700 | |
---|---|---|
committer | 2018-05-23 11:10:07 -0700 | |
commit | 5883569eeec77e2a430473226652905b88212424 (patch) | |
tree | fc390f0a8a800d2829a782fcc15039f4a4f2400b /test | |
parent | 40494bbe89369161fb31a7b7639b16e797e077fb (diff) | |
parent | e169f20cd0330484339795685417abc962edf5d2 (diff) |
Merge pull request #15523 from kpayson64/client_lb_flake
Add more failure logging to client_lb_end2end_test
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/end2end/client_lb_end2end_test.cc | 15 |
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 c2f3281fbe..eeec8e90bd 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( |