mirror of
https://github.com/apache/impala.git
synced 2025-12-23 21:08:39 -05:00
IMPALA-6933: Avoids db name collisions for Kudu tests
Kudu tests generate temporary db names in a way so that its unlikely, yet possible to collide. A recent test failure indicates such a collision came up. The fix changes the way that the name is generated so that it includes the classes name for which the db name is generated. This db name will make it easier to see which test created it and the name will not collide with other names generated by other tests. Testing: - ran the updated test locally Change-Id: I7c2f8a35fec90ae0dabe80237d83954668b47f6e Reviewed-on: http://gerrit.cloudera.org:8080/10513 Reviewed-by: Michael Brown <mikeb@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
committed by
Impala Public Jenkins
parent
0b9334a564
commit
4653637b9e
@@ -344,7 +344,8 @@ def conn(request):
|
||||
- get_conn_timeout(): The timeout, in seconds, to use for this connection.
|
||||
The returned connection will have a 'db_name' property.
|
||||
|
||||
See the 'unique_database' fixture above if you want to use Impala's custom python
|
||||
DEPRECATED:
|
||||
See the 'unique_database' fixture above to use Impala's custom python
|
||||
API instead of DB-API.
|
||||
"""
|
||||
db_name = __call_cls_method_if_exists(request.cls, "get_db_name")
|
||||
@@ -380,6 +381,10 @@ def __unique_conn(db_name=None, timeout=DEFAULT_CONN_TIMEOUT):
|
||||
# The database no longer exists and the conn is closed.
|
||||
|
||||
The returned connection will have a 'db_name' property.
|
||||
|
||||
DEPRECATED:
|
||||
See the 'unique_database' fixture above to use Impala's custom python
|
||||
API instead of DB-API.
|
||||
"""
|
||||
if not db_name:
|
||||
db_name = choice(ascii_lowercase) + "".join(sample(ascii_lowercase + digits, 5))
|
||||
@@ -407,6 +412,10 @@ def __auto_closed_conn(db_name=None, timeout=DEFAULT_CONN_TIMEOUT):
|
||||
The connection will be closed upon exiting the block.
|
||||
|
||||
The returned connection will have a 'db_name' property.
|
||||
|
||||
DEPRECATED:
|
||||
See the 'unique_database' fixture above to use Impala's custom python
|
||||
API instead of DB-API.
|
||||
"""
|
||||
default_impalad = pytest.config.option.impalad.split(',')[0]
|
||||
impalad_host = default_impalad.split(':')[0]
|
||||
@@ -431,6 +440,10 @@ def cursor(conn):
|
||||
|
||||
The returned cursor will have a 'conn' property. The 'conn' will have a 'db_name'
|
||||
property.
|
||||
|
||||
DEPRECATED:
|
||||
See the 'unique_database' fixture above to use Impala's custom python
|
||||
API instead of DB-API.
|
||||
"""
|
||||
with __auto_closed_cursor(conn) as cur:
|
||||
yield cur
|
||||
@@ -443,6 +456,10 @@ def cls_cursor(conn):
|
||||
|
||||
The returned cursor will have a 'conn' property. The 'conn' will have a 'db_name'
|
||||
property.
|
||||
|
||||
DEPRECATED:
|
||||
See the 'unique_database' fixture above to use Impala's custom python
|
||||
API instead of DB-API.
|
||||
"""
|
||||
with __auto_closed_cursor(conn) as cur:
|
||||
yield cur
|
||||
@@ -456,6 +473,10 @@ def unique_cursor():
|
||||
|
||||
The returned cursor will have a 'conn' property. The 'conn' will have a 'db_name'
|
||||
property.
|
||||
|
||||
DEPRECATED:
|
||||
See the 'unique_database' fixture above to use Impala's custom python
|
||||
API instead of DB-API.
|
||||
"""
|
||||
with __unique_conn() as conn:
|
||||
with __auto_closed_cursor(conn) as cur:
|
||||
|
||||
Reference in New Issue
Block a user