This is an automated email from the ASF dual-hosted git repository. michaelsmith pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit e02ee90287a96f94d78f812bc8f6d35f00836458 Author: Riza Suminto <[email protected]> AuthorDate: Mon Jun 26 16:59:53 2023 -0700 IMPALA-12245: Move test_display_src_socket_in_query_cause test_display_src_socket_in_query_cause close the session by calling coordinator WebUI directly. This can interfere with test_query_progress that run sleep query for 100 ms. This patch move test_display_src_socket_in_query_cause out of TestWebPage class into its own test class so it does not interfere with other tests in TestWebPage. Testing: - Repeat scenario mentioned in IMPALA-12245 and confirm that test_query_progress can pass. Change-Id: If19f419b26a0456f48ebf6046b0e73ae376dfbeb Reviewed-on: http://gerrit.cloudera.org:8080/20123 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- tests/webserver/test_web_pages.py | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/webserver/test_web_pages.py b/tests/webserver/test_web_pages.py index 7cfeeab98..11ff2100a 100644 --- a/tests/webserver/test_web_pages.py +++ b/tests/webserver/test_web_pages.py @@ -882,6 +882,26 @@ class TestWebPage(ImpalaTestSuite): "href='http://.*:%s/'" % self.IMPALAD_TEST_PORT[0], self.IMPALAD_TEST_PORT, regex=True, headers={'X-Forwarded-Context': '/gateway'}) + def test_catalog_operations_endpoint(self): + """Test to check that the /operations endpoint returns 200 OK.""" + page = requests.get("http://localhost:25020/operations") + assert page.status_code == requests.codes.ok + page = requests.head("http://localhost:25020/operations") + assert page.status_code == requests.codes.ok + + def test_query_progress(self): + """Tests that /queries page shows query progress.""" + query = "select count(*) from functional_parquet.alltypes where bool_col = sleep(100)" + response_json = self.__run_query_and_get_debug_page( + query, self.QUERIES_URL, expected_state=self.client.QUERY_STATES["RUNNING"]) + for json_part in response_json['in_flight_queries']: + if query in json_part['stmt']: + assert json_part["query_progress"] == "0 / 4 ( 0%)" + + +class TestWebPageAndCloseSession(ImpalaTestSuite): + ROOT_URL = "http://localhost:{0}/" + @SkipIfDockerizedCluster.daemon_logs_not_exposed def test_display_src_socket_in_query_cause(self): # Execute a long running query then cancel it from the WebUI. @@ -908,19 +928,3 @@ class TestWebPage(ImpalaTestSuite): requests.get(close_session_url) self.assert_impalad_log_contains("INFO", "Session closed from Impala\'s debug " "web interface by user: 'anonymous' at", expected_count=-1) - - def test_catalog_operations_endpoint(self): - """Test to check that the /operations endpoint returns 200 OK.""" - page = requests.get("http://localhost:25020/operations") - assert page.status_code == requests.codes.ok - page = requests.head("http://localhost:25020/operations") - assert page.status_code == requests.codes.ok - - def test_query_progress(self): - """Tests that /queries page shows query progress.""" - query = "select count(*) from functional_parquet.alltypes where bool_col = sleep(100)" - response_json = self.__run_query_and_get_debug_page( - query, self.QUERIES_URL, expected_state=self.client.QUERY_STATES["RUNNING"]) - for json_part in response_json['in_flight_queries']: - if query in json_part['stmt']: - assert json_part["query_progress"] == "0 / 4 ( 0%)"
