Skip to content

Commit b2d62d4

Browse files
fix(postgres): randomize test_reader username to prevent CI collisions
Signed-off-by: sakshipatil-hue <sakshipatil8674788@gmail.com>
1 parent e6ac0e5 commit b2d62d4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import typing as t
2+
import uuid
23
from contextlib import contextmanager
34
import pytest
45
from pytest import FixtureRequest
@@ -53,13 +54,14 @@ def create_users(
5354
_cleanup_user(engine_adapter, user_name)
5455

5556
for role_name in role_names:
56-
user_name = f"test_{role_name}"
57+
random_suffix = uuid.uuid4().hex[:6]
58+
user_name = f"test_{role_name}_{random_suffix}"
5759
password = random_id()
5860
engine_adapter.execute(f"CREATE USER \"{user_name}\" WITH PASSWORD '{password}'")
5961
engine_adapter.execute(f'GRANT USAGE ON SCHEMA public TO "{user_name}"')
6062
created_users.append(user_name)
6163
roles[role_name] = {"username": user_name, "password": password}
62-
64+
6365
yield roles
6466

6567
finally:

0 commit comments

Comments
 (0)