From a227bcc8059c6c43602061543be13c5b0c9fdbcf Mon Sep 17 00:00:00 2001 From: ivyazmitinov Date: Fri, 28 Jun 2024 21:30:09 +0200 Subject: [PATCH] - Fix tests - Investigate citus_local_tables --- src/test/regress/citus_tests/run_test.py | 3 ++- ..._multiple_databases_distributed_deadlock_detection.py | 9 ++------- src/test/regress/sql/citus_local_tables.sql | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/test/regress/citus_tests/run_test.py b/src/test/regress/citus_tests/run_test.py index 9a648c0ab..fa430fa0a 100755 --- a/src/test/regress/citus_tests/run_test.py +++ b/src/test/regress/citus_tests/run_test.py @@ -241,7 +241,8 @@ def run_python_test(test_name, args): "pytest", "pytest", "--numprocesses", - "auto", + # Tests may be heavy, so limit the concurrency + "2", "--count", str(args["repeat"]), str(test_path), diff --git a/src/test/regress/citus_tests/test/test_multiple_databases_distributed_deadlock_detection.py b/src/test/regress/citus_tests/test/test_multiple_databases_distributed_deadlock_detection.py index 58ad565c5..6df95b4f7 100644 --- a/src/test/regress/citus_tests/test/test_multiple_databases_distributed_deadlock_detection.py +++ b/src/test/regress/citus_tests/test/test_multiple_databases_distributed_deadlock_detection.py @@ -89,8 +89,8 @@ async def test_multiple_databases_distributed_deadlock_detection(cluster): await asyncio.wait_for(run_deadlocked_queries(), 300) - await first_connection.commit() - await second_connection.commit() + await first_connection.rollback() + await second_connection.rollback() async def enable_maintenance_when_deadlocks_ready(): """Function to enable maintenance daemons, when all the expected deadlock queries are ready""" @@ -147,8 +147,3 @@ async def test_multiple_databases_distributed_deadlock_detection(cluster): ) too_many_clients_errors_count = cursor.fetchone()[0] assert too_many_clients_errors_count == 0 - - for db_name in db_names: - cluster.coordinator.sql( - "DROP TABLE public.deadlock_detection_test", dbname=db_name - ) diff --git a/src/test/regress/sql/citus_local_tables.sql b/src/test/regress/sql/citus_local_tables.sql index e33fbc6cc..ace8c22c9 100644 --- a/src/test/regress/sql/citus_local_tables.sql +++ b/src/test/regress/sql/citus_local_tables.sql @@ -579,6 +579,7 @@ alter table parent_1 add constraint fkey2 foreign key(a) references parent_2(a); SELECT create_reference_table('ref_table'); alter table parent_1 drop constraint fkey_test_drop; select count(*) from pg_constraint where conname = 'fkey_test_drop'; +SELECT * FROM pg_dist_shard ORDER BY shardid; -- verify we still preserve the child-parent hierarchy after all conversions -- check the shard partition select inhrelid::regclass from pg_inherits where (select inhparent::regclass::text) ~ '^parent_1_\d{7}$' order by 1;