IMPALA-6477: Fix flakiness with thrift-server-test THe ThriftKerberizedParamsTest.SslConnectivity backend test verifies that when kerberos and TLS are switched on, we cannot perform a negotiation with a non TLS enabled client.
The test works as expected, however, the error messages can be different in some scenarios. This patch just updates the test to expect a different error message that has the same effect. This change also links KRB5_REALM_OVERRIDE back with the rpc-mgr-test, as one test run showed a similar failure as IMPALA-6268. It's possible that this is due to IMPALA-6448. Change-Id: I6294447416ecccc864b842013487f4d93afadc6b Reviewed-on: http://gerrit.cloudera.org:8080/9247 Reviewed-by: Alex Behm <alex.b...@cloudera.com> Tested-by: Impala Public Jenkins Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/bf892858 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/bf892858 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/bf892858 Branch: refs/heads/2.x Commit: bf892858a088a9490a32ea8692055cbd2ad254fe Parents: ffb67b2 Author: Sailesh Mukil <sail...@cloudera.com> Authored: Wed Feb 7 13:26:05 2018 -0800 Committer: Impala Public Jenkins <impala-public-jenk...@gerrit.cloudera.org> Committed: Thu Feb 8 21:10:19 2018 +0000 ---------------------------------------------------------------------- be/src/rpc/CMakeLists.txt | 1 + be/src/rpc/thrift-server-test.cc | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/bf892858/be/src/rpc/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/be/src/rpc/CMakeLists.txt b/be/src/rpc/CMakeLists.txt index e4d96e2..1c7adc6 100644 --- a/be/src/rpc/CMakeLists.txt +++ b/be/src/rpc/CMakeLists.txt @@ -50,6 +50,7 @@ ADD_BE_TEST(rpc-mgr-test) add_dependencies(rpc-mgr-test rpc_test_proto) target_link_libraries(rpc-mgr-test rpc_test_proto) target_link_libraries(rpc-mgr-test security-test-for-impala) +target_link_libraries(rpc-mgr-test ${KRB5_REALM_OVERRIDE}) ADD_BE_TEST(rpc-mgr-kerberized-test) add_dependencies(rpc-mgr-kerberized-test rpc_test_proto) http://git-wip-us.apache.org/repos/asf/impala/blob/bf892858/be/src/rpc/thrift-server-test.cc ---------------------------------------------------------------------- diff --git a/be/src/rpc/thrift-server-test.cc b/be/src/rpc/thrift-server-test.cc index f1e0f4b..8bd7275 100644 --- a/be/src/rpc/thrift-server-test.cc +++ b/be/src/rpc/thrift-server-test.cc @@ -172,8 +172,14 @@ TEST_P(ThriftKerberizedParamsTest, SslConnectivity) { // When Kerberos is ON, the SASL negotiation happens inside Open(). We expect that to // fail beacuse the server expects the client to negotiate over an encrypted // connection. - EXPECT_STR_CONTAINS(non_ssl_client.Open().GetDetail(), - "No more data to read"); + // The expected error message can either state "No more data to read" or + // "Couldn't open transport". + const std::string& status = non_ssl_client.Open().GetDetail(); + size_t found_substr = status.find("No more data to read"); + if (found_substr == string::npos) { + EXPECT_STR_CONTAINS(non_ssl_client.Open().GetDetail(), + "Couldn't open transport"); + } } }