Make single_node_truncate.sql re-runnable

First of all, this commit sets next_shard_id for
single_node_truncate.sql because shard ids in the test output were
changing whenever we modify a prior test file.

Then the flaky test detector started complaining about
single_node_truncate.sql. We fix that by specifying the correct
test dependency for it in run_test.py.
pull/6741/head
Onur Tirtir 2023-03-02 12:42:40 +03:00
parent 40105bf1fc
commit a9820e96a3
3 changed files with 38 additions and 35 deletions

View File

@ -85,6 +85,7 @@ if __name__ == "__main__":
"create_role_propagation": TestDeps(None, ["multi_cluster_management"]),
"single_node_enterprise": TestDeps(None),
"single_node": TestDeps(None),
"single_node_truncate": TestDeps(None),
"multi_extension": TestDeps(None, repeatable=False),
"multi_test_helpers": TestDeps(None),
"multi_insert_select": TestDeps("base_schedule"),

View File

@ -1,6 +1,7 @@
CREATE SCHEMA single_node_truncate;
SET search_path TO single_node_truncate;
SET citus.shard_replication_factor TO 1;
SET citus.next_shard_id TO 91630500;
-- helper view that prints out local table names and sizes in the schema
CREATE VIEW table_sizes AS
SELECT
@ -31,9 +32,9 @@ SELECT * FROM table_sizes;
name | has_data
---------------------------------------------------------------------
citus_local | f
citus_local_102049 | t
citus_local_91630501 | t
ref | t
ref_102048 | t
ref_91630500 | t
(4 rows)
-- verify that this UDF is noop on Citus local tables
@ -47,9 +48,9 @@ SELECT * FROM table_sizes;
name | has_data
---------------------------------------------------------------------
citus_local | f
citus_local_102049 | t
citus_local_91630501 | t
ref | t
ref_102048 | t
ref_91630500 | t
(4 rows)
-- test that we allow cascading truncates to citus local tables
@ -65,9 +66,9 @@ SELECT * FROM table_sizes;
name | has_data
---------------------------------------------------------------------
citus_local | f
citus_local_102049 | t
citus_local_91630501 | t
ref | f
ref_102048 | t
ref_91630500 | t
(4 rows)
ROLLBACK;
@ -98,14 +99,14 @@ SELECT * FROM table_sizes;
name | has_data
---------------------------------------------------------------------
citus_local | f
citus_local_102049 | t
citus_local_91630501 | t
dist | f
dist_102051 | t
dist_102052 | t
dist_102053 | t
dist_102054 | t
dist_91630503 | t
dist_91630504 | t
dist_91630505 | t
dist_91630506 | t
ref | f
ref_102048 | t
ref_91630500 | t
(9 rows)
ROLLBACK;
@ -121,14 +122,14 @@ SELECT * FROM table_sizes;
name | has_data
---------------------------------------------------------------------
citus_local | f
citus_local_102049 | t
citus_local_91630501 | t
dist | f
dist_102051 | t
dist_102052 | t
dist_102053 | t
dist_102054 | t
dist_91630503 | t
dist_91630504 | t
dist_91630505 | t
dist_91630506 | t
ref | t
ref_102048 | t
ref_91630500 | t
(9 rows)
ROLLBACK;

View File

@ -1,6 +1,7 @@
CREATE SCHEMA single_node_truncate;
SET search_path TO single_node_truncate;
SET citus.shard_replication_factor TO 1;
SET citus.next_shard_id TO 91630500;
-- helper view that prints out local table names and sizes in the schema
CREATE VIEW table_sizes AS