You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2018/08/14 21:26:54 UTC

impala git commit: IMPALA-7428: Fix flaky test_shell_command_line::test_large_sql

Repository: impala
Updated Branches:
  refs/heads/master ea615d1d8 -> c0ff4fe8f


IMPALA-7428: Fix flaky test_shell_command_line::test_large_sql

This patch fixes the flaky test by rewriting the test to perform a
large query from a non-existent table instead since the test focuses
on Impala shell performance and not Impala performance in general.
This patch also reduces the time limit from 30 seconds to 10 seconds
and increases the number of columns in the query to 10K.

Testing:
- Ran all shell tests

Change-Id: Ic87891f34872da65aac5ce02caf01da1c050efa5
Reviewed-on: http://gerrit.cloudera.org:8080/11201
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/c0ff4fe8
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/c0ff4fe8
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/c0ff4fe8

Branch: refs/heads/master
Commit: c0ff4fe8f6caa0047b9c425d497fda5f61d60d04
Parents: ea615d1
Author: Fredy Wijaya <fw...@cloudera.com>
Authored: Mon Aug 13 11:39:19 2018 -0700
Committer: Impala Public Jenkins <im...@cloudera.com>
Committed: Tue Aug 14 20:09:24 2018 +0000

----------------------------------------------------------------------
 tests/shell/test_shell_commandline.py | 30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/c0ff4fe8/tests/shell/test_shell_commandline.py
----------------------------------------------------------------------
diff --git a/tests/shell/test_shell_commandline.py b/tests/shell/test_shell_commandline.py
index 1cc7e57..b0f2f03 100644
--- a/tests/shell/test_shell_commandline.py
+++ b/tests/shell/test_shell_commandline.py
@@ -676,33 +676,27 @@ class TestImpalaShell(ImpalaTestSuite):
     assert "Encountered: Unexpected character" in result.stderr
 
   def test_large_sql(self, unique_database):
+    # In this test, we are only interested in the performance of Impala shell and not
+    # the performance of Impala in general. So, this test will execute a large query
+    # from a non-existent table since this will make the query execution time negligible.
     sql_file, sql_path = tempfile.mkstemp()
-    os.write(sql_file, "create table large_table (\n")
-    num_cols = 4000
-    for i in xrange(num_cols):
-      os.write(sql_file, "col_{0} int".format(i))
-      if i < num_cols - 1:
-        os.write(sql_file, ",")
-      os.write(sql_file, "\n")
-    os.write(sql_file, ");")
+    num_cols = 10000
     os.write(sql_file, "select \n")
-
     for i in xrange(num_cols):
       if i < num_cols:
-        os.write(sql_file, 'col_{0} as a{1},\n'.format(i, i))
-        os.write(sql_file, 'col_{0} as b{1},\n'.format(i, i))
-        os.write(sql_file, 'col_{0} as c{1}{2}\n'.format(i, i,
-                                                     ',' if i < num_cols - 1 else ''))
-    os.write(sql_file, 'from large_table;')
+        os.write(sql_file, "col_{0} as a{1},\n".format(i, i))
+        os.write(sql_file, "col_{0} as b{1},\n".format(i, i))
+        os.write(sql_file, "col_{0} as c{1}{2}\n".format(
+            i, i, "," if i < num_cols - 1 else ""))
+    os.write(sql_file, "from non_existence_large_table;")
     os.close(sql_file)
 
     try:
-      args = "-f {0} -d {1}".format(sql_path, unique_database)
+      args = "-q -f {0} -d {1}".format(sql_path, unique_database)
       start_time = time()
-      result = run_impala_shell_cmd(args)
+      run_impala_shell_cmd(args, False)
       end_time = time()
-      assert "Fetched 0 row(s)" in result.stderr
-      time_limit_s = 30
+      time_limit_s = 10
       actual_time_s = end_time - start_time
       assert actual_time_s <= time_limit_s, (
           "It took {0} seconds to execute the query. Time limit is {1} seconds.".format(