From cd837512773d2b46f27c15821f36aa8d217a49eb Mon Sep 17 00:00:00 2001 From: Sakshi Patil Date: Sun, 23 Aug 2026 19:54:24 +0530 Subject: [PATCH] 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. --- .../integration/test_integration_postgres.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/core/engine_adapter/integration/test_integration_postgres.py b/tests/core/engine_adapter/integration/test_integration_postgres.py index f236fdebce..1bcfc942d9 100644 --- a/tests/core/engine_adapter/integration/test_integration_postgres.py +++ b/tests/core/engine_adapter/integration/test_integration_postgres.py @@ -1,3 +1,4 @@ +import uuid import typing as t from contextlib import contextmanager import pytest @@ -49,17 +50,15 @@ def create_users( try: for role_name in role_names: - user_name = f"test_{role_name}" - _cleanup_user(engine_adapter, user_name) - - for role_name in role_names: - user_name = f"test_{role_name}" + random_suffix = uuid.uuid4().hex[:6] + user_name = f"test_{role_name}_{random_suffix}" + password = random_id() engine_adapter.execute(f"CREATE USER \"{user_name}\" WITH PASSWORD '{password}'") engine_adapter.execute(f'GRANT USAGE ON SCHEMA public TO "{user_name}"') + created_users.append(user_name) roles[role_name] = {"username": user_name, "password": password} - yield roles finally: