This is an automated email from the ASF dual-hosted git repository. alexey pushed a commit to branch branch-1.13.x in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 07eb5a97f17046f6ee61b2a28bdfbe578d3f6d2b Author: Alexey Serbin <[email protected]> AuthorDate: Sun Sep 20 10:37:26 2020 -0700 [kudu-tool-test] fix ClusterNameResolverFileCorrupt with glibc 2.31 This patch updates the expected error message in the ToolTest.ClusterNameResolverFileCorrupt scenario to make the test pass on Ubuntu 20.04 LTS (it should fix it on other platforms which use newer glibc versions). Without this patch, the scenario failed on Ubuntu 20.04 LTS: src/kudu/tools/kudu-tool-test.cc:637: Failure Value of: stderr Expected: has substring "Network error: Could not connect to the cluster: unable to resolve address for bad: Name or service not known" Actual: "W0919 23:39:50.032436 1041101 flags.cc:405] Enabled unsafe flag: --openssl_security_level_override=0\nW0919 23:39:50.032559 1041101 flags.cc:405] Enabled unsafe flag: --never_fsync=true\nNetwork error: Could not connect to the cluster: unable to resolve address for bad: Temporary failure in name resolution" Instead of tailoring the errno-converted message for every platform, it's easier to rely in the essential part of it that corresponds to the DNS resolver failure. In addition, I did a minor cleanup on the code around, removing calls of the Substitute() function where a fixed string is enough. Change-Id: I3eb0991cb2d4311051e55e231cb4fe6d065aa632 Reviewed-on: http://gerrit.cloudera.org:8080/16478 Tested-by: Kudu Jenkins Reviewed-by: Grant Henke <[email protected]> (cherry picked from commit d8ab44c6864172d4b990adf31f7d84fd33e4ae15) Reviewed-on: http://gerrit.cloudera.org:8080/16488 --- src/kudu/tools/kudu-tool-test.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/kudu/tools/kudu-tool-test.cc b/src/kudu/tools/kudu-tool-test.cc index cfc4595..39231d2 100644 --- a/src/kudu/tools/kudu-tool-test.cc +++ b/src/kudu/tools/kudu-tool-test.cc @@ -5698,7 +5698,7 @@ TEST_F(ToolTest, ClusterNameResolverFileCorrupt) { NO_FATALS(CheckCorruptClusterInfoConfigFile( Substitute(R"*($0:)*""\n" R"*( master_addresses: $1)*", kClusterName, master_addrs_str), - Substitute("Not found: parse field clusters_info error: invalid node; "))); + "Not found: parse field clusters_info error: invalid node; ")); // Missing specified cluster name. NO_FATALS(CheckCorruptClusterInfoConfigFile( @@ -5713,20 +5713,15 @@ TEST_F(ToolTest, ClusterNameResolverFileCorrupt) { Substitute(R"*(clusters_info:)*""\n" R"*( $0:)*""\n" R"*( master_addresses_some_suffix: $1)*", kClusterName, master_addrs_str), - Substitute("Not found: parse field master_addresses error: invalid node; "))); + "Not found: parse field master_addresses error: invalid node; ")); // Invalid 'master_addresses' value. NO_FATALS(CheckCorruptClusterInfoConfigFile( Substitute(R"*(clusters_info:)*""\n" R"*( $0:)*""\n" R"*( master_addresses: bad,masters,addresses)*", kClusterName), -#ifdef __APPLE__ - Substitute("Network error: Could not connect to the cluster: unable to resolve " - "address for bad: nodename nor servname provided, or not known"))); -#else - Substitute("Network error: Could not connect to the cluster: unable to resolve " - "address for bad: Name or service not known"))); -#endif + "Network error: Could not connect to the cluster: unable to resolve " + "address for bad: ")); } TEST_F(ToolTest, ClusterNameResolverNormal) {
