Skip to content

Commit cd83751

Browse files
ix(postgres): randomize test_reader username to prevent CI collisions
Resolves #5972. Appended a random UUID suffix to the Postgres test user creation logic to ensure parallel integration tests are completely isolated and do not collide.
1 parent e6ac0e5 commit cd83751

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎tests/core/engine_adapter/integration/test_integration_postgres.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import uuid
12
import typing as t
23
from contextlib import contextmanager
34
import pytest
@@ -49,17 +50,15 @@ def create_users(
4950

5051
try:
5152
for role_name in role_names:
52-
user_name = f"test_{role_name}"
53-
_cleanup_user(engine_adapter, user_name)
54-
55-
for role_name in role_names:
56-
user_name = f"test_{role_name}"
53+
random_suffix = uuid.uuid4().hex[:6]
54+
user_name = f"test_{role_name}_{random_suffix}"
55+
5756
password = random_id()
5857
engine_adapter.execute(f"CREATE USER \"{user_name}\" WITH PASSWORD '{password}'")
5958
engine_adapter.execute(f'GRANT USAGE ON SCHEMA public TO "{user_name}"')
59+
6060
created_users.append(user_name)
6161
roles[role_name] = {"username": user_name, "password": password}
62-
6362
yield roles
6463

6564
finally:

0 commit comments

Comments
 (0)