From ac59489df9a96fe4770a907fe479c605ed05a12b Mon Sep 17 00:00:00 2001 From: Lars Volker Date: Tue, 10 Jan 2017 15:25:43 +0100 Subject: [PATCH] IMPALA-4751: Remove blank line from raw_text template The additional blank line can break tooling which uses the /query_profile_encoded endpoint and has been erroneously introduced in the fix for IMPALA-3918. Change-Id: I9b688aa9e2423b0271c8891a983e5b22707d8dbc Reviewed-on: http://gerrit.cloudera.org:8080/5664 Reviewed-by: Jim Apple Reviewed-by: Tim Armstrong Tested-by: Impala Public Jenkins --- tests/webserver/test_web_pages.py | 12 ++++++++++++ www/raw_text.tmpl | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/webserver/test_web_pages.py b/tests/webserver/test_web_pages.py index c54a2115b..0f993df94 100644 --- a/tests/webserver/test_web_pages.py +++ b/tests/webserver/test_web_pages.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. +from tests.common.impala_cluster import ImpalaCluster from tests.common.impala_test_suite import ImpalaTestSuite import requests @@ -28,3 +29,14 @@ class TestWebPage(ImpalaTestSuite): assert page.status_code == requests.codes.ok page = requests.get("http://localhost:25020/memz") assert page.status_code == requests.codes.ok + + def test_query_profile_encoded_unknown_query_id(self): + """Test that /query_profile_encoded error message starts with the expected line in + case of missing query and does not contain any leading whitespace. + """ + cluster = ImpalaCluster() + impalad = cluster.get_any_impalad() + result = impalad.service.read_debug_webpage("query_profile_encoded?query_id=123") + assert result.startswith("Could not obtain runtime profile: Query id") + + diff --git a/www/raw_text.tmpl b/www/raw_text.tmpl index 88e2af06e..9021cdd55 100644 --- a/www/raw_text.tmpl +++ b/www/raw_text.tmpl @@ -15,5 +15,7 @@ software distributed under the License is distributed on an KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -}} -{{contents}} \ No newline at end of file +}}{{! +When making changes to this file, please make sure to not introduce any whitespace before +the main content, or it may break tools relying on the content starting on the first line. +}}{{contents}}