You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/05/29 15:34:01 UTC

[impala] 05/07: IMPALA-7238: Use custom timeout for create unique database

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

tarmstrong pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 68caba1313a1380d9d99acf7aed209b62e43dbb6
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Tue Jul 3 16:20:15 2018 -0700

    IMPALA-7238: Use custom timeout for create unique database
    
    test_kudu.TestCreateExternalTables() saw a timeout when
    creating the unique database for its tests.
    
    __unique_conn() opens a connection, creates a unique database,
    then returns another connection in that database. It takes
    a custom timeout argument, but the timeout is only for the
    returned connection. The first connection to create the
    unique database uses the default timeout of 45 seconds.
    
    This patch changes the first connection to use the custom
    timeout. For Kudu tests, this is 5 minutes rather than 45
    seconds.
    
    Change-Id: I4f2beb5bc027a4bb44e854bf1dd8919807a92ea0
    Reviewed-on: http://gerrit.cloudera.org:8080/10862
    Reviewed-by: Joe McDonnell <jo...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 tests/conftest.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/conftest.py b/tests/conftest.py
index fe6b332..a1f1859 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -356,7 +356,7 @@ def conn(request):
     with __unique_conn(db_name=db_name, timeout=timeout) as conn:
       yield conn
   else:
-    with __auto_closed_conn(db_name=db_name) as conn:
+    with __auto_closed_conn(db_name=db_name, timeout=timeout) as conn:
       yield conn
 
 
@@ -388,7 +388,7 @@ def __unique_conn(db_name=None, timeout=DEFAULT_CONN_TIMEOUT):
   """
   if not db_name:
     db_name = choice(ascii_lowercase) + "".join(sample(ascii_lowercase + digits, 5))
-  with __auto_closed_conn() as conn:
+  with __auto_closed_conn(timeout=timeout) as conn:
     with __auto_closed_cursor(conn) as cur:
       cur.execute("CREATE DATABASE %s" % db_name)
   with __auto_closed_conn(db_name=db_name, timeout=timeout) as conn: