This is an automated email from the ASF dual-hosted git repository. stigahuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 261517cfb406efc910dbc83ccf6dfae83cb6ce4d Author: Csaba Ringhofer <[email protected]> AuthorDate: Thu Jan 30 20:56:02 2025 +0100 IMPALA-13702: Fix Webserver.StartWithPasswordFileTest with JDK 17 Only use the last 3 characters of curl output in status code tests to ignore warnings on JDK 17. See the Jira for the details of the warning. Change-Id: I73d696b0e439457f69df4deea93583eefd32483c Reviewed-on: http://gerrit.cloudera.org:8080/22431 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- be/src/util/webserver-test.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/be/src/util/webserver-test.cc b/be/src/util/webserver-test.cc index cbe0651cd..7123dba12 100644 --- a/be/src/util/webserver-test.cc +++ b/be/src/util/webserver-test.cc @@ -438,7 +438,14 @@ string curl_status_code(const string& curl_options, int32_t port = FLAGS_webserv string cmd = Substitute("curl -s -f -w \"%{http_code}\" $0 'http://127.0.0.1:$1'", curl_options, port); cout << cmd << endl; - return exec(cmd.c_str()); + string result = exec(cmd.c_str()); + if (result.size() > 3) { + // In some cases the stdout of curl can contain extra characters before the status + // code (see IMPALA-13702 for details). As http status codes are expected to be 3 + // digits it is always ok to return the last 3 characters. + result = result.substr(result.size() - 3, 3); + } + return result; } class CookieJar {
