From 23554583fa946b1634edaadf64664fce83fdc888 Mon Sep 17 00:00:00 2001 From: Nitish Upreti Date: Wed, 14 Sep 2022 17:19:39 -0700 Subject: [PATCH] Update test and expected result --- .../expected/failure_on_create_subscription.out | 13 +++++++++---- .../regress/sql/failure_on_create_subscription.sql | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/test/regress/expected/failure_on_create_subscription.out b/src/test/regress/expected/failure_on_create_subscription.out index d04f7a4a9..8243f9910 100644 --- a/src/test/regress/expected/failure_on_create_subscription.out +++ b/src/test/regress/expected/failure_on_create_subscription.out @@ -41,16 +41,21 @@ SELECT * FROM shards_in_workers; 103 | worker1 (4 rows) --- failure on creating the subscription -SELECT citus.mitmproxy('conn.onQuery(query="CREATE SUBSCRIPTION").kill()'); +-- Failure on creating the subscription +-- Failing exactly on CREATE SUBSCRIPTION is causing flaky test where we either 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 uber CREATE SUBSCRIPTION operation. +SELECT citus.mitmproxy('conn.onQuery(query="ALTER SUBSCRIPTION").kill()'); mitmproxy --------------------------------------------------------------------- (1 row) SELECT master_move_shard_placement(101, 'localhost', :worker_1_port, 'localhost', :worker_2_proxy_port); -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 +ERROR: connection not open +CONTEXT: while executing command on localhost:xxxxx -- Verify that the shard is not moved and the number of rows are still 100k SELECT * FROM shards_in_workers; shardid | worker diff --git a/src/test/regress/sql/failure_on_create_subscription.sql b/src/test/regress/sql/failure_on_create_subscription.sql index 5cdff2f25..0e1cd73af 100644 --- a/src/test/regress/sql/failure_on_create_subscription.sql +++ b/src/test/regress/sql/failure_on_create_subscription.sql @@ -37,7 +37,7 @@ SELECT * FROM shards_in_workers; -- 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. +-- Instead fail on the next step (ALTER SUBSCRIPTION) instead which is also required logically as part of uber CREATE SUBSCRIPTION operation. SELECT citus.mitmproxy('conn.onQuery(query="ALTER SUBSCRIPTION").kill()'); SELECT master_move_shard_placement(101, 'localhost', :worker_1_port, 'localhost', :worker_2_proxy_port);