You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by cs...@apache.org on 2020/11/24 14:42:41 UTC

[impala] 02/05: IMPALA-4238: make TestClientSsl more robust

This is an automated email from the ASF dual-hosted git repository.

csringhofer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 78da6adab8ac2bd3a1c67431a5f255da9cf10308
Author: Tim Armstrong <ta...@cloudera.com>
AuthorDate: Fri Nov 20 16:38:36 2020 -0800

    IMPALA-4238: make TestClientSsl more robust
    
    This changes the test to wait until it is executing in the backend
    before trying to cancel it. This should remove planning time as
    a variable that might cause the test to be flaky (e.g. if planning
    is slow on S3 because of the time taken to list files).
    
    Also dump the /queries debug page when the assertion is hit to
    aid debugging.
    
    Change-Id: I0c884f76659005e7245a156ee33c249b86662b75
    Reviewed-on: http://gerrit.cloudera.org:8080/16760
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 tests/custom_cluster/test_client_ssl.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/custom_cluster/test_client_ssl.py b/tests/custom_cluster/test_client_ssl.py
index cf2c212..f14dbe1 100644
--- a/tests/custom_cluster/test_client_ssl.py
+++ b/tests/custom_cluster/test_client_ssl.py
@@ -16,6 +16,7 @@
 # under the License.
 #
 
+import json
 import logging
 import os
 import pytest
@@ -95,10 +96,14 @@ class TestClientSsl(CustomClusterTestSuite):
     # Test cancelling a query
     impalad = ImpaladService(socket.getfqdn())
     assert impalad.wait_for_num_in_flight_queries(0)
+    impalad.wait_for_metric_value('impala-server.backend-num-queries-executing', 0)
     p = ImpalaShell(vector, args=["--ssl"])
     p.send_cmd("SET DEBUG_ACTION=0:OPEN:WAIT")
     p.send_cmd("select count(*) from functional.alltypes")
-    assert impalad.wait_for_num_in_flight_queries(1)
+    # Wait until the query has been planned and started executing, at which point it
+    # should be cancellable.
+    impalad.wait_for_metric_value('impala-server.backend-num-queries-executing', 1,
+            timeout=60)
 
     LOG = logging.getLogger('test_client_ssl')
     LOG.info("Cancelling query")
@@ -111,7 +116,8 @@ class TestClientSsl(CustomClusterTestSuite):
       LOG.info("Sending signal...")
       os.kill(p.pid(), signal.SIGINT)
       num_tries += 1
-      assert num_tries < 30, "SIGINT was not caught by shell within 30s"
+      assert num_tries < 30, ("SIGINT was not caught by shell within 30s. Queries: " +
+              json.dumps(impalad.get_queries_json(), indent=2))
 
     p.send_cmd("profile")
     result = p.get_result()