From bf33d2a993f0b74fe0bc2a95d3d4e48abd90432c Mon Sep 17 00:00:00 2001 From: Nitish Upreti Date: Wed, 14 Sep 2022 17:11:23 -0700 Subject: [PATCH] Fail on alter instead --- .../regress/sql/failure_on_create_subscription.sql | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/test/regress/sql/failure_on_create_subscription.sql b/src/test/regress/sql/failure_on_create_subscription.sql index b901446b6..5cdff2f25 100644 --- a/src/test/regress/sql/failure_on_create_subscription.sql +++ b/src/test/regress/sql/failure_on_create_subscription.sql @@ -32,12 +32,15 @@ INSERT INTO t SELECT x, x+1, MD5(random()::text) FROM generate_series(1,100000) -- Initial shard placements SELECT * FROM shards_in_workers; --- failure on creating the subscription -SELECT citus.mitmproxy('conn.onQuery(query="CREATE SUBSCRIPTION").kill()'); --- Log minimal messages to avoid printing the error message and make the test flaky -SET client_min_messages TO ERROR; +-- Failure on creating the subscription +-- Failing exactly on CREATE SUBSCRIPTION is causing flaky test where we fail with : +-- 1) ERROR: connection to the remote node localhost:xxxxx failed with the following error: ERROR: subscription "citus_shard_move_subscription_xxxxxxx" does not exist +-- another command is already in progress +-- 2) ERROR: connection to the remote node localhost:xxxxx failed with the following error: another command is already in progress +-- Instead fail on the next step (ALTER SUBSCRIPTION) instead which is also required logically as part of CREATE SUBSCRIPTION. + +SELECT citus.mitmproxy('conn.onQuery(query="ALTER SUBSCRIPTION").kill()'); SELECT master_move_shard_placement(101, 'localhost', :worker_1_port, 'localhost', :worker_2_proxy_port); -RESET client_min_messages; -- Verify that the shard is not moved and the number of rows are still 100k SELECT * FROM shards_in_workers;