Merge pull request #55564 from kssenii/add-test-toast

Add a test
This commit is contained in:
Kseniia Sumarokova 2023-10-15 14:12:57 +02:00 committed by GitHub
commit 0cab773e7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -719,6 +719,36 @@ def test_too_many_parts(started_cluster):
pg_manager2.drop_materialized_db()
def test_toast(started_cluster):
table = "test_toast"
pg_manager.execute(
f"CREATE TABLE {table} (id integer PRIMARY KEY, txt text, other text)"
)
pg_manager.create_materialized_db(
ip=started_cluster.postgres_ip,
port=started_cluster.postgres_port,
settings=[
f"materialized_postgresql_tables_list = '{table}'",
"materialized_postgresql_backoff_min_ms = 100",
"materialized_postgresql_backoff_max_ms = 100",
],
)
pg_manager.execute(
f"""\
INSERT INTO {table} (id, txt)\
VALUES (1, (SELECT array_to_string(ARRAY(SELECT chr((100 + round(random() * 25)) :: integer) FROM generate_series(1,30000) as t(i)), '')))
"""
)
check_tables_are_synchronized(
instance,
table,
postgres_database=pg_manager.get_default_database(),
order_by="id",
)
if __name__ == "__main__":
cluster.start()
input("Cluster created, press any key to destroy...")