From 989a3b54c92b2341150e18f91cb83431ef96d7b2 Mon Sep 17 00:00:00 2001 From: Ahmet Gedemenli Date: Wed, 7 Dec 2022 20:28:55 +0300 Subject: [PATCH] Disable maintenance daemon for cleanup test (#6551) Disabling the cleanup in maintenance daemon, to prevent a flaky test. --- .../failure_online_move_shard_placement.out | 16 ++++++++++++++++ .../sql/failure_online_move_shard_placement.sql | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/src/test/regress/expected/failure_online_move_shard_placement.out b/src/test/regress/expected/failure_online_move_shard_placement.out index a2e7efec3..7ca9b67c6 100644 --- a/src/test/regress/expected/failure_online_move_shard_placement.out +++ b/src/test/regress/expected/failure_online_move_shard_placement.out @@ -295,6 +295,14 @@ SELECT citus.mitmproxy('conn.allow()'); CALL citus_cleanup_orphaned_resources(); NOTICE: cleaned up 4 orphaned resources +-- disable maintenance daemon cleanup, to prevent the flaky test +ALTER SYSTEM SET citus.defer_shard_delete_interval TO -1; +SELECT pg_reload_conf(); + pg_reload_conf +--------------------------------------------------------------------- + t +(1 row) + -- failure on dropping subscription SELECT citus.mitmproxy('conn.onQuery(query="^DROP SUBSCRIPTION").killall()'); mitmproxy @@ -326,6 +334,14 @@ SELECT COUNT(*) 1 (1 row) +-- reset back +ALTER SYSTEM RESET citus.defer_shard_delete_interval; +SELECT pg_reload_conf(); + pg_reload_conf +--------------------------------------------------------------------- + t +(1 row) + -- cleanup leftovers -- then, verify we don't see any error for already dropped subscription SET client_min_messages TO WARNING; diff --git a/src/test/regress/sql/failure_online_move_shard_placement.sql b/src/test/regress/sql/failure_online_move_shard_placement.sql index fbe82b211..dea2dac00 100644 --- a/src/test/regress/sql/failure_online_move_shard_placement.sql +++ b/src/test/regress/sql/failure_online_move_shard_placement.sql @@ -125,6 +125,10 @@ SELECT master_move_shard_placement(101, 'localhost', :worker_1_port, 'localhost' SELECT citus.mitmproxy('conn.allow()'); CALL citus_cleanup_orphaned_resources(); +-- disable maintenance daemon cleanup, to prevent the flaky test +ALTER SYSTEM SET citus.defer_shard_delete_interval TO -1; +SELECT pg_reload_conf(); + -- failure on dropping subscription SELECT citus.mitmproxy('conn.onQuery(query="^DROP SUBSCRIPTION").killall()'); SELECT master_move_shard_placement(101, 'localhost', :worker_1_port, 'localhost', :worker_2_proxy_port); @@ -137,6 +141,10 @@ SELECT COUNT(*) $$DROP SUBSCRIPTION citus_shard_move_subscription_10_15$$) WHERE success AND result = 'DROP SUBSCRIPTION'; +-- reset back +ALTER SYSTEM RESET citus.defer_shard_delete_interval; +SELECT pg_reload_conf(); + -- cleanup leftovers -- then, verify we don't see any error for already dropped subscription SET client_min_messages TO WARNING;