From 798070ec058fe75757587c9e9916cc35c623f427 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 11 Apr 2019 18:16:50 -0400 Subject: [PATCH] Re-order some regression test scripts for more parallelism. Move the strings, numerology, insert, insert_conflict, select and errors tests to be parts of nearby parallel groups, instead of executing by themselves. (Moving "select" required adjusting the constraints test, which uses a table named "tmp" as select also does. There don't seem to be any other conflicts.) Move psql and stats_ext to the next parallel group, where the rules test also has a long runtime. To make it safe to run stats_ext in parallel with rules, I adjusted the latter to only dump views/rules from the pg_catalog and public schemas, which was what it was doing anyway. stats_ext makes some views in a transient schema, which now will not affect rules. Reorder serial_schedule to match parallel_schedule. Discussion: https://postgr.es/m/735.1554935715@sss.pgh.pa.us --- src/test/regress/expected/rules.out | 7 +++-- src/test/regress/expected/sanity_check.out | 1 + src/test/regress/input/constraints.source | 2 +- src/test/regress/output/constraints.source | 2 +- src/test/regress/parallel_schedule | 36 ++++++++-------------- src/test/regress/serial_schedule | 20 ++++++------ src/test/regress/sql/rules.sql | 7 +++-- 7 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 4638374a76..2f048f3bdc 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1282,7 +1282,9 @@ drop table cchild; -- -- temporarily disable fancy output, so view changes create less diff noise \a\t -SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schema' ORDER BY viewname; +SELECT viewname, definition FROM pg_views +WHERE schemaname IN ('pg_catalog', 'public') +ORDER BY viewname; iexit| SELECT ih.name, ih.thepath, interpt_pp(ih.thepath, r.thepath) AS exit @@ -2418,7 +2420,8 @@ toyemp| SELECT emp.name, (12 * emp.salary) AS annualsal FROM emp; SELECT tablename, rulename, definition FROM pg_rules - ORDER BY tablename, rulename; +WHERE schemaname IN ('pg_catalog', 'public') +ORDER BY tablename, rulename; pg_settings|pg_settings_n|CREATE RULE pg_settings_n AS ON UPDATE TO pg_catalog.pg_settings DO INSTEAD NOTHING; pg_settings|pg_settings_u|CREATE RULE pg_settings_u AS diff --git a/src/test/regress/expected/sanity_check.out b/src/test/regress/expected/sanity_check.out index a77a8db93f..392e8a4957 100644 --- a/src/test/regress/expected/sanity_check.out +++ b/src/test/regress/expected/sanity_check.out @@ -206,6 +206,7 @@ time_tbl|f timestamp_tbl|f timestamptz_tbl|f timetz_tbl|f +tmp|f varchar_tbl|f view_base_table|t -- restore normal output mode diff --git a/src/test/regress/input/constraints.source b/src/test/regress/input/constraints.source index 98dd4210e9..0abf95577e 100644 --- a/src/test/regress/input/constraints.source +++ b/src/test/regress/input/constraints.source @@ -201,7 +201,7 @@ DELETE FROM INSERT_TBL; ALTER SEQUENCE INSERT_SEQ RESTART WITH 4; -CREATE TABLE tmp (xd INT, yd TEXT, zd INT); +CREATE TEMP TABLE tmp (xd INT, yd TEXT, zd INT); INSERT INTO tmp VALUES (null, 'Y', null); INSERT INTO tmp VALUES (5, '!check failed', null); diff --git a/src/test/regress/output/constraints.source b/src/test/regress/output/constraints.source index e8389064b0..465d6da0e0 100644 --- a/src/test/regress/output/constraints.source +++ b/src/test/regress/output/constraints.source @@ -291,7 +291,7 @@ NOTICE: drop cascades to table atacc2 -- DELETE FROM INSERT_TBL; ALTER SEQUENCE INSERT_SEQ RESTART WITH 4; -CREATE TABLE tmp (xd INT, yd TEXT, zd INT); +CREATE TEMP TABLE tmp (xd INT, yd TEXT, zd INT); INSERT INTO tmp VALUES (null, 'Y', null); INSERT INTO tmp VALUES (5, '!check failed', null); INSERT INTO tmp VALUES (null, 'try again', null); diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index 4c6dad8b5a..8229e10909 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -15,15 +15,12 @@ test: tablespace # ---------- test: boolean char name varchar text int2 int4 int8 oid float4 float8 bit numeric txid uuid enum money rangetypes pg_lsn regproc -# Depends on things setup during char, varchar and text -test: strings -# Depends on int2, int4, int8, float4, float8 -test: numerology - # ---------- # The second group of parallel tests +# strings depends on char, varchar and text +# numerology depends on int2, int4, int8, float4, float8 # ---------- -test: point lseg line box path polygon circle date time timetz timestamp timestamptz interval inet macaddr macaddr8 tstypes fsm +test: strings numerology point lseg line box path polygon circle date time timetz timestamp timestamptz interval inet macaddr macaddr8 tstypes fsm # ---------- # Another group of parallel tests @@ -35,8 +32,6 @@ test: geometry horology regex oidjoins type_sanity opr_sanity misc_sanity commen # ---------- # These four each depend on the previous one # ---------- -test: insert -test: insert_conflict test: create_function_1 test: create_type test: create_table @@ -48,19 +43,19 @@ test: create_function_2 # execute two copy tests parallel, to check that copy itself # is concurrent safe. # ---------- -test: copy copyselect copydml +test: copy copyselect copydml insert insert_conflict # ---------- # More groups of parallel tests # ---------- test: create_misc create_operator create_procedure -# These depend on the above two +# These depend on create_misc and create_operator test: create_index create_index_spgist create_view index_including index_including_gist # ---------- # Another group of parallel tests # ---------- -test: create_aggregate create_function_3 create_cast constraints triggers inherit typed_table vacuum drop_if_exists updatable_views rolenames roleattributes create_am hash_func +test: create_aggregate create_function_3 create_cast constraints triggers select inherit typed_table vacuum drop_if_exists updatable_views rolenames roleattributes create_am hash_func errors # ---------- # sanity_check does a vacuum, affecting the sort order of SELECT * @@ -68,18 +63,12 @@ test: create_aggregate create_function_3 create_cast constraints triggers inheri # ---------- test: sanity_check -# ---------- -# Believe it or not, select creates a table, subsequent -# tests need. -# ---------- -test: errors -test: select -ignore: random - # ---------- # Another group of parallel tests +# Note: the ignore: line does not run random, just mark it as ignorable # ---------- -test: select_into select_distinct select_distinct_on select_implicit select_having subselect union case join aggregates transactions random portals arrays btree_index hash_index update namespace prepared_xacts delete +ignore: random +test: select_into select_distinct select_distinct_on select_implicit select_having subselect union case join aggregates transactions random portals arrays btree_index hash_index update delete namespace prepared_xacts # ---------- # Another group of parallel tests @@ -89,10 +78,11 @@ test: brin gin gist spgist privileges init_privs security_label collate matview # ---------- # Another group of parallel tests # ---------- -test: create_table_like alter_generic alter_operator misc psql async dbsize misc_functions sysviews tsrf tidscan stats_ext +test: create_table_like alter_generic alter_operator misc async dbsize misc_functions sysviews tsrf tidscan -# rules cannot run concurrently with any test that creates a view -test: rules psql_crosstab amutils +# rules cannot run concurrently with any test that creates +# a view or rule in the public schema +test: rules psql psql_crosstab amutils stats_ext # run by itself so it can run parallel workers test: select_parallel diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule index 296e4cf843..9839087faa 100644 --- a/src/test/regress/serial_schedule +++ b/src/test/regress/serial_schedule @@ -50,8 +50,6 @@ test: opr_sanity test: misc_sanity test: comments test: expressions -test: insert -test: insert_conflict test: create_function_1 test: create_type test: create_table @@ -59,19 +57,22 @@ test: create_function_2 test: copy test: copyselect test: copydml +test: insert +test: insert_conflict test: create_misc test: create_operator test: create_procedure test: create_index test: create_index_spgist +test: create_view test: index_including test: index_including_gist -test: create_view test: create_aggregate test: create_function_3 test: create_cast test: constraints test: triggers +test: select test: inherit test: typed_table test: vacuum @@ -81,9 +82,8 @@ test: rolenames test: roleattributes test: create_am test: hash_func -test: sanity_check test: errors -test: select +test: sanity_check test: select_into test: select_distinct test: select_distinct_on @@ -129,21 +129,21 @@ test: create_table_like test: alter_generic test: alter_operator test: misc -test: psql test: async test: dbsize test: misc_functions test: sysviews test: tsrf test: tidscan -test: stats_ext test: rules +test: psql test: psql_crosstab +test: amutils +test: stats_ext test: select_parallel test: write_parallel test: publication test: subscription -test: amutils test: select_views test: portals_p2 test: foreign_key @@ -159,14 +159,14 @@ test: window test: xmlmap test: functional_deps test: advisory_lock +test: indirect_toast +test: equivclass test: json test: jsonb test: json_encoding test: jsonpath test: jsonpath_encoding test: jsonb_jsonpath -test: indirect_toast -test: equivclass test: plancache test: limit test: plpgsql diff --git a/src/test/regress/sql/rules.sql b/src/test/regress/sql/rules.sql index 505dabddc6..a042e59546 100644 --- a/src/test/regress/sql/rules.sql +++ b/src/test/regress/sql/rules.sql @@ -775,10 +775,13 @@ drop table cchild; -- temporarily disable fancy output, so view changes create less diff noise \a\t -SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schema' ORDER BY viewname; +SELECT viewname, definition FROM pg_views +WHERE schemaname IN ('pg_catalog', 'public') +ORDER BY viewname; SELECT tablename, rulename, definition FROM pg_rules - ORDER BY tablename, rulename; +WHERE schemaname IN ('pg_catalog', 'public') +ORDER BY tablename, rulename; -- restore normal output mode \a\t