Give details for exception message

test_branch
gindibay 2023-07-28 23:35:14 +03:00
parent bb62b84ad7
commit ed40dfe1a7
2 changed files with 20 additions and 8 deletions

View File

@ -77,13 +77,15 @@ starting permutation: s1-begin s1-node-not-found s1-end
step s1-begin: step s1-begin:
BEGIN; BEGIN;
s1: NOTICE: Node not found. s1: NOTICE: Node not found.
step s1-node-not-found: step s1-node-not-found:
DO $$ DO $$
DECLARE DECLARE
v_node_id int; v_node_id int := -1;
v_node_exists boolean := true; v_node_exists boolean := true;
v_count int :=-1; v_count int := -1;
v_exception_message text;
v_expected_exception_message text := '';
BEGIN BEGIN
-- Get a node-id that does not exist in the cluster -- Get a node-id that does not exist in the cluster
while v_node_exists loop while v_node_exists loop
@ -99,7 +101,11 @@ DECLARE
select citus_pause_node(v_node_id); select citus_pause_node(v_node_id);
EXCEPTION EXCEPTION
WHEN SQLSTATE 'P0002' THEN WHEN SQLSTATE 'P0002' THEN
RAISE NOTICE 'Node not found.'; GET STACKED DIAGNOSTICS v_exception_message = MESSAGE_TEXT;
v_expected_exception_message := 'node ' || v_node_id || ' not found';
if v_exception_message = v_expected_exception_message then
RAISE NOTICE 'Node not found.';
end if;
END; END;
$$ $$
LANGUAGE plpgsql; LANGUAGE plpgsql;

View File

@ -46,9 +46,11 @@ step "s1-node-not-found"
{ {
DO $$ DO $$
DECLARE DECLARE
v_node_id int; v_node_id int := -1;
v_node_exists boolean := true; v_node_exists boolean := true;
v_count int :=-1; v_count int := -1;
v_exception_message text;
v_expected_exception_message text := '';
BEGIN BEGIN
-- Get a node-id that does not exist in the cluster -- Get a node-id that does not exist in the cluster
@ -68,7 +70,11 @@ step "s1-node-not-found"
EXCEPTION EXCEPTION
WHEN SQLSTATE 'P0002' THEN WHEN SQLSTATE 'P0002' THEN
RAISE NOTICE 'Node not found.'; GET STACKED DIAGNOSTICS v_exception_message = MESSAGE_TEXT;
v_expected_exception_message := 'node ' || v_node_id || ' not found';
if v_exception_message = v_expected_exception_message then
RAISE NOTICE 'Node not found.';
end if;
END; END;
$$ $$
LANGUAGE plpgsql; LANGUAGE plpgsql;