From 009303e31f29e5536f8cc2b0e950f9bdde757fda Mon Sep 17 00:00:00 2001 From: Alexey Masterov Date: Thu, 17 Jul 2025 13:44:19 +0200 Subject: [PATCH] Connect to the target branch, not the main one --- test_runner/random_ops/test_random_ops.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test_runner/random_ops/test_random_ops.py b/test_runner/random_ops/test_random_ops.py index e2a9ace881..819b20ba82 100644 --- a/test_runner/random_ops/test_random_ops.py +++ b/test_runner/random_ops/test_random_ops.py @@ -124,6 +124,7 @@ class NeonBranch: if "parent_timestamp" in branch["branch"] else datetime.fromtimestamp(0, tz=UTC) ) + self.connection_uri: str | None = branch["connection_uris"][0]["connection_uri"] if "connection_uris" in branch["branch"] else None self.connect_env: dict[str, str] | None = None if self.connection_parameters: self.connect_env = { @@ -507,7 +508,9 @@ class NeonProject: target_branch.id, self.generate_branch_name(), ) - with psycopg2.connect(self.connection_uri) as conn: + if target_branch.connection_uri is None: + raise RuntimeError(f"The branch {target_branch.id} does not have connection URI") + with psycopg2.connect(target_branch.connection_uri) as conn: with conn.cursor() as cur: cur.execute("SELECT value FROM sanity_check WHERE name = 'snapsot_name'") snapshot_name = None