This commit is contained in:
Yatsishin Ilya 2024-08-19 13:58:44 +00:00
parent 9f88f60a1c
commit 90ad110a7d

View File

@ -1,5 +1,6 @@
import pytest
import uuid
import time
import psycopg2
import os.path as p
@ -59,8 +60,6 @@ instance2 = cluster.add_instance(
pg_manager = PostgresManager()
pg_manager2 = PostgresManager()
pg_manager_instance2 = PostgresManager()
pg_manager3 = PostgresManager()
@pytest.fixture(scope="module")
def started_cluster():
@ -82,12 +81,6 @@ def started_cluster():
pg_manager2.init(
instance2, cluster.postgres_ip, cluster.postgres_port, "postgres_database2"
)
pg_manager3.init(
instance,
cluster.postgres_ip,
cluster.postgres_port,
default_database="postgres-postgres",
)
yield cluster
@ -924,16 +917,27 @@ def test_failed_load_from_snapshot(started_cluster):
def test_symbols_in_publication_name(started_cluster):
table = "test_symbols_in_publication_name"
id = uuid.uuid4()
db = f'test_{id}'
table = f"test_symbols_in_publication_name"
pg_manager3 = PostgresManager()
pg_manager3.init(
instance,
cluster.postgres_ip,
cluster.postgres_port,
default_database=db,
)
pg_manager3.create_postgres_table(table)
instance.query(
f"INSERT INTO `{pg_manager3.get_default_database()}`.`{table}` SELECT number, number from numbers(0, 50)"
f"INSERT INTO `{db}`.`{table}` SELECT number, number from numbers(0, 50)"
)
pg_manager3.create_materialized_db(
ip=started_cluster.postgres_ip,
port=started_cluster.postgres_port,
materialized_database=db,
settings=[
f"materialized_postgresql_tables_list = '{table}'",
"materialized_postgresql_backoff_min_ms = 100",
@ -941,8 +945,10 @@ def test_symbols_in_publication_name(started_cluster):
],
)
check_tables_are_synchronized(
instance, table, postgres_database=pg_manager3.get_default_database()
instance, table, materialized_database=db, postgres_database=db
)
pg_manager3.drop_materialized_db(db)
pg_manager3.execute(f'drop table "{table}"')
def test_generated_columns(started_cluster):