diff --git a/src/test/regress/expected/isolation_citus_pause_node.out b/src/test/regress/expected/isolation_citus_pause_node.out index 19f855156..ad2213bf4 100644 --- a/src/test/regress/expected/isolation_citus_pause_node.out +++ b/src/test/regress/expected/isolation_citus_pause_node.out @@ -80,8 +80,23 @@ step s1-begin: s1: NOTICE: Node not found. step s1-node-not-found: DO $$ -BEGIN - select citus_pause_node(25000); +DECLARE + v_node_id int; + v_node_exists boolean := true; + v_count int :=-1; + BEGIN + -- Get a node-id that does not exist in the cluster + while v_node_exists loop + --get a random node id in the range of 1000 to 2000 + v_node_id := FLOOR(RANDOM()*(2000- 1000 + 1)) + 1000; + begin + select count(0) into v_count from pg_dist_node where nodeid = v_node_id; + if v_count = 0 then + v_node_exists := false; + end if; + end; + end loop; + select citus_pause_node(v_node_id); EXCEPTION WHEN SQLSTATE 'P0002' THEN RAISE NOTICE 'Node not found.'; diff --git a/src/test/regress/spec/isolation_citus_pause_node.spec b/src/test/regress/spec/isolation_citus_pause_node.spec index 72af10eef..6a9fc9bbb 100644 --- a/src/test/regress/spec/isolation_citus_pause_node.spec +++ b/src/test/regress/spec/isolation_citus_pause_node.spec @@ -45,8 +45,26 @@ step "s1-begin" step "s1-node-not-found" { DO $$ + DECLARE + v_node_id int; + v_node_exists boolean := true; + v_count int :=-1; BEGIN - select citus_pause_node(25000); + + -- Get a node-id that does not exist in the cluster + + while v_node_exists loop + --get a random node id in the range of 1000 to 2000 + v_node_id := FLOOR(RANDOM()*(2000- 1000 + 1)) + 1000; + begin + select count(0) into v_count from pg_dist_node where nodeid = v_node_id; + if v_count = 0 then + v_node_exists := false; + end if; + end; + end loop; + select citus_pause_node(v_node_id); + EXCEPTION WHEN SQLSTATE 'P0002' THEN