Make upgrade_columnar_after runnable multiple times

This commit hides port numbers in upgrade_columnar_after because the
port numbers assigned to nodes in upgrade schedule differ from the ones
that flaky test detector assigns.
pull/6628/head
Onur Tirtir 2023-01-16 13:38:20 +03:00
parent 821f26cc74
commit 994f67185f
2 changed files with 32 additions and 28 deletions

View File

@ -228,10 +228,12 @@ BEGIN;
22 22
(1 row) (1 row)
-- make sure that serial is preserved -- Make sure that serial is preserved.
-- since we run "after schedule" twice and "rollback" wouldn't undo --
-- sequence changes, it can be 22 or 33, not a different value -- Since we might run "after schedule" several times for flaky test
SELECT max(id) in (22, 33) FROM text_data; -- detection and "rollback" wouldn't undo sequence changes, "id" should
-- look like below:
SELECT max(id) >= 11 AND max(id) % 11 = 0 FROM text_data;
?column? ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
@ -292,7 +294,7 @@ SELECT COUNT(*)=10 FROM columnar_schema_members_pg_depend;
DROP TABLE columnar_schema_members, columnar_schema_members_pg_depend; DROP TABLE columnar_schema_members, columnar_schema_members_pg_depend;
-- Check the same for workers too. -- Check the same for workers too.
SELECT run_command_on_workers( SELECT success, result FROM run_command_on_workers(
$$ $$
SELECT pg_class.oid INTO columnar_schema_members SELECT pg_class.oid INTO columnar_schema_members
FROM pg_class, pg_namespace FROM pg_class, pg_namespace
@ -308,44 +310,44 @@ WHERE classid = 'pg_am'::regclass::oid AND
deptype = 'n'; deptype = 'n';
$$ $$
); );
run_command_on_workers success | result
--------------------------------------------------------------------- ---------------------------------------------------------------------
(localhost,10201,t,"SELECT 10") t | SELECT 10
(localhost,10202,t,"SELECT 10") t | SELECT 10
(2 rows) (2 rows)
SELECT run_command_on_workers( SELECT success, result FROM run_command_on_workers(
$$ $$
(TABLE columnar_schema_members EXCEPT TABLE columnar_schema_members_pg_depend) (TABLE columnar_schema_members EXCEPT TABLE columnar_schema_members_pg_depend)
UNION UNION
(TABLE columnar_schema_members_pg_depend EXCEPT TABLE columnar_schema_members); (TABLE columnar_schema_members_pg_depend EXCEPT TABLE columnar_schema_members);
$$ $$
); );
run_command_on_workers success | result
--------------------------------------------------------------------- ---------------------------------------------------------------------
(localhost,10201,t,"") t |
(localhost,10202,t,"") t |
(2 rows) (2 rows)
SELECT run_command_on_workers( SELECT success, result FROM run_command_on_workers(
$$ $$
SELECT COUNT(*)=10 FROM columnar_schema_members_pg_depend; SELECT COUNT(*)=10 FROM columnar_schema_members_pg_depend;
$$ $$
); );
run_command_on_workers success | result
--------------------------------------------------------------------- ---------------------------------------------------------------------
(localhost,10201,t,t) t | t
(localhost,10202,t,t) t | t
(2 rows) (2 rows)
SELECT run_command_on_workers( SELECT success, result FROM run_command_on_workers(
$$ $$
DROP TABLE columnar_schema_members, columnar_schema_members_pg_depend; DROP TABLE columnar_schema_members, columnar_schema_members_pg_depend;
$$ $$
); );
run_command_on_workers success | result
--------------------------------------------------------------------- ---------------------------------------------------------------------
(localhost,10201,t,"DROP TABLE") t | DROP TABLE
(localhost,10202,t,"DROP TABLE") t | DROP TABLE
(2 rows) (2 rows)

View File

@ -101,10 +101,12 @@ BEGIN;
INSERT INTO text_data (value) SELECT generate_random_string(1024 * 10) FROM generate_series(0,10); INSERT INTO text_data (value) SELECT generate_random_string(1024 * 10) FROM generate_series(0,10);
SELECT count(DISTINCT value) FROM text_data; SELECT count(DISTINCT value) FROM text_data;
-- make sure that serial is preserved -- Make sure that serial is preserved.
-- since we run "after schedule" twice and "rollback" wouldn't undo --
-- sequence changes, it can be 22 or 33, not a different value -- Since we might run "after schedule" several times for flaky test
SELECT max(id) in (22, 33) FROM text_data; -- detection and "rollback" wouldn't undo sequence changes, "id" should
-- look like below:
SELECT max(id) >= 11 AND max(id) % 11 = 0 FROM text_data;
-- since we run "after schedule" twice, rollback the transaction -- since we run "after schedule" twice, rollback the transaction
-- to avoid getting "table already exists" errors -- to avoid getting "table already exists" errors
@ -160,7 +162,7 @@ DROP TABLE columnar_schema_members, columnar_schema_members_pg_depend;
-- Check the same for workers too. -- Check the same for workers too.
SELECT run_command_on_workers( SELECT success, result FROM run_command_on_workers(
$$ $$
SELECT pg_class.oid INTO columnar_schema_members SELECT pg_class.oid INTO columnar_schema_members
FROM pg_class, pg_namespace FROM pg_class, pg_namespace
@ -177,7 +179,7 @@ WHERE classid = 'pg_am'::regclass::oid AND
$$ $$
); );
SELECT run_command_on_workers( SELECT success, result FROM run_command_on_workers(
$$ $$
(TABLE columnar_schema_members EXCEPT TABLE columnar_schema_members_pg_depend) (TABLE columnar_schema_members EXCEPT TABLE columnar_schema_members_pg_depend)
UNION UNION
@ -185,13 +187,13 @@ UNION
$$ $$
); );
SELECT run_command_on_workers( SELECT success, result FROM run_command_on_workers(
$$ $$
SELECT COUNT(*)=10 FROM columnar_schema_members_pg_depend; SELECT COUNT(*)=10 FROM columnar_schema_members_pg_depend;
$$ $$
); );
SELECT run_command_on_workers( SELECT success, result FROM run_command_on_workers(
$$ $$
DROP TABLE columnar_schema_members, columnar_schema_members_pg_depend; DROP TABLE columnar_schema_members, columnar_schema_members_pg_depend;
$$ $$