From d493bb526a0b1442b1976adeb80df7c492b45c3f Mon Sep 17 00:00:00 2001 From: Colm McHugh Date: Wed, 2 Jul 2025 10:38:02 +0000 Subject: [PATCH] Test if regress test local_shard_execution_dropped_column is not deterministically repeatable --- src/test/regress/expected/local_shard_execution.out | 6 ++++++ .../local_shard_execution_dropped_column.out | 13 +++++++++++++ src/test/regress/sql/local_shard_execution.sql | 2 ++ .../sql/local_shard_execution_dropped_column.sql | 4 ++++ 4 files changed, 25 insertions(+) diff --git a/src/test/regress/expected/local_shard_execution.out b/src/test/regress/expected/local_shard_execution.out index 2b1fa3c0b..639cfcb7e 100644 --- a/src/test/regress/expected/local_shard_execution.out +++ b/src/test/regress/expected/local_shard_execution.out @@ -3286,6 +3286,12 @@ SELECT pg_sleep(.1); -- wait to make sure the config has changed before running (1 row) +SELECT 1; + ?column? +--------------------------------------------------------------------- + 1 +(1 row) + SET client_min_messages TO ERROR; SET search_path TO public; DROP SCHEMA local_shard_execution CASCADE; diff --git a/src/test/regress/expected/local_shard_execution_dropped_column.out b/src/test/regress/expected/local_shard_execution_dropped_column.out index 6a2fe1b0b..85695e144 100644 --- a/src/test/regress/expected/local_shard_execution_dropped_column.out +++ b/src/test/regress/expected/local_shard_execution_dropped_column.out @@ -193,6 +193,13 @@ execute p4(8); NOTICE: executing the command locally: UPDATE local_shard_execution_dropped_column.t1_2460000 t1 SET a = (a OPERATOR(pg_catalog.+) 1) WHERE (c OPERATOR(pg_catalog.=) 8) execute p4(8); NOTICE: executing the command locally: UPDATE local_shard_execution_dropped_column.t1_2460000 t1 SET a = (a OPERATOR(pg_catalog.+) 1) WHERE (c OPERATOR(pg_catalog.=) 8) +-- arbitrary change to trigger test flakiness on this regress test +SELECT 'random'::text; + text +--------------------------------------------------------------------- + random +(1 row) + \c - - - :master_port -- one another combination is that the shell table -- has a dropped column but not the shard, via rebalance operation @@ -204,6 +211,12 @@ SELECT citus_move_shard_placement(2460000, 'localhost', :worker_1_port, 'localho (1 row) +SELECT public.wait_for_resource_cleanup(); -- otherwise fails flakiness tests + wait_for_resource_cleanup +--------------------------------------------------------------------- + +(1 row) + \c - - - :worker_2_port SET search_path TO local_shard_execution_dropped_column; -- show the dropped columns diff --git a/src/test/regress/sql/local_shard_execution.sql b/src/test/regress/sql/local_shard_execution.sql index 2845693c9..a60d75e38 100644 --- a/src/test/regress/sql/local_shard_execution.sql +++ b/src/test/regress/sql/local_shard_execution.sql @@ -1441,6 +1441,8 @@ ALTER SYSTEM RESET citus.local_hostname; SELECT pg_reload_conf(); SELECT pg_sleep(.1); -- wait to make sure the config has changed before running the GUC +SELECT 1; + SET client_min_messages TO ERROR; SET search_path TO public; DROP SCHEMA local_shard_execution CASCADE; diff --git a/src/test/regress/sql/local_shard_execution_dropped_column.sql b/src/test/regress/sql/local_shard_execution_dropped_column.sql index 1d7dac0b7..51f67f5bd 100644 --- a/src/test/regress/sql/local_shard_execution_dropped_column.sql +++ b/src/test/regress/sql/local_shard_execution_dropped_column.sql @@ -78,6 +78,9 @@ execute p4(8); execute p4(8); execute p4(8); +-- arbitrary change to trigger test flakiness on this regress test +SELECT 'random'::text; + \c - - - :master_port -- one another combination is that the shell table @@ -86,6 +89,7 @@ SET search_path TO local_shard_execution_dropped_column; ALTER TABLE t1 DROP COLUMN a; SELECT citus_move_shard_placement(2460000, 'localhost', :worker_1_port, 'localhost', :worker_2_port, 'block_writes'); +SELECT public.wait_for_resource_cleanup(); -- otherwise fails flakiness tests \c - - - :worker_2_port SET search_path TO local_shard_execution_dropped_column;