diff --git a/tests/integration/dbapi/async/V2/conftest.py b/tests/integration/dbapi/async/V2/conftest.py index 725e29f24a..17fd3c8e85 100644 --- a/tests/integration/dbapi/async/V2/conftest.py +++ b/tests/integration/dbapi/async/V2/conftest.py @@ -1,4 +1,6 @@ -from random import choice, randint +import random +import string +from random import choice from typing import Tuple from pytest import fixture @@ -120,7 +122,8 @@ async def service_account_no_user( database_name: str, ) -> Tuple[str, Secret]: # function-level fixture so we need to make sa name is unique - sa_account_name = f"{database_name}_sa_no_user_{randint(0, 1000)}" + randomness = "".join(random.choices(string.ascii_letters + string.digits, k=2)) + sa_account_name = f"{database_name}_sa_no_user_{randomness}" with connection_system_engine_no_db.cursor() as cursor: await cursor.execute( f'CREATE SERVICE ACCOUNT "{sa_account_name}" ' diff --git a/tests/integration/dbapi/sync/V2/conftest.py b/tests/integration/dbapi/sync/V2/conftest.py index 6ac4fac94b..87a8961c49 100644 --- a/tests/integration/dbapi/sync/V2/conftest.py +++ b/tests/integration/dbapi/sync/V2/conftest.py @@ -1,4 +1,6 @@ -from random import choice, randint +import random +import string +from random import choice from typing import Tuple from pytest import fixture @@ -120,7 +122,8 @@ def service_account_no_user( database_name: str, ) -> Tuple[str, Secret]: # function-level fixture so we need to make sa name is unique - sa_account_name = f"{database_name}_sa_no_user_{randint(0, 1000)}" + randomness = "".join(random.choices(string.ascii_letters + string.digits, k=2)) + sa_account_name = f"{database_name}_sa_no_user_{randomness}" with connection_system_engine_no_db.cursor() as cursor: cursor.execute( f'CREATE SERVICE ACCOUNT "{sa_account_name}" '