Add ORDER BY to stabilize tablespace test for partitioned index
Hi, hackers!
I noticed the Peter's commit 7e3c54168d9ec058cb3c9d47f8105b1d32dc8ceb that
stabilizes certain tests by adding ORDER BY clause in tests and remember
that I saw the same error in tablespaces test for creation of partitioned
index. It comes very rarely and test fails on inverted order of parent and
child.
PFA small patch that stabilizes that test in the same style by adding ORDER
BY.
--
Best regards,
Pavel Borisov
Postgres Professional: http://postgrespro.com <http://www.postgrespro.com>
Attachments:
v1-0001-Stabilize-tablespaces-test-for-partitioned-indexe.patchapplication/octet-stream; name=v1-0001-Stabilize-tablespaces-test-for-partitioned-indexe.patchDownload
From 8d195e021166d6f4d816bbeeac3555bf61bf7b29 Mon Sep 17 00:00:00 2001
From: Pavel Borisov <pashkin.elfe@gmail.com>
Date: Tue, 30 Mar 2021 18:03:10 +0400
Subject: [PATCH v1] Stabilize tablespaces test for partitioned indexes. When
doing tablespace test sometimes (very rarely) the order of parent and child
tables change which made test fail.
---
src/test/regress/input/tablespace.source | 2 +-
src/test/regress/output/tablespace.source | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/regress/input/tablespace.source b/src/test/regress/input/tablespace.source
index 1a181016d71..d689d2b7d79 100644
--- a/src/test/regress/input/tablespace.source
+++ b/src/test/regress/input/tablespace.source
@@ -88,7 +88,7 @@ CREATE TABLE testschema.part1 PARTITION OF testschema.part FOR VALUES IN (1);
CREATE INDEX part_a_idx ON testschema.part (a) TABLESPACE regress_tblspace;
CREATE TABLE testschema.part2 PARTITION OF testschema.part FOR VALUES IN (2);
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
- where c.reltablespace = t.oid AND c.relname LIKE 'part%_idx';
+ where c.reltablespace = t.oid AND c.relname LIKE 'part%_idx' ORDER BY 1;
\d testschema.part
\d+ testschema.part
\d testschema.part1
diff --git a/src/test/regress/output/tablespace.source b/src/test/regress/output/tablespace.source
index 94c5f023c68..2980159d492 100644
--- a/src/test/regress/output/tablespace.source
+++ b/src/test/regress/output/tablespace.source
@@ -132,7 +132,7 @@ CREATE TABLE testschema.part1 PARTITION OF testschema.part FOR VALUES IN (1);
CREATE INDEX part_a_idx ON testschema.part (a) TABLESPACE regress_tblspace;
CREATE TABLE testschema.part2 PARTITION OF testschema.part FOR VALUES IN (2);
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
- where c.reltablespace = t.oid AND c.relname LIKE 'part%_idx';
+ where c.reltablespace = t.oid AND c.relname LIKE 'part%_idx' ORDER BY 1;
relname | spcname
-------------+------------------
part1_a_idx | regress_tblspace
--
2.28.0
On Fri, Apr 9, 2021 at 1:30 PM Pavel Borisov <pashkin.elfe@gmail.com> wrote:
Hi, hackers!
I noticed the Peter's commit 7e3c54168d9ec058cb3c9d47f8105b1d32dc8ceb that stabilizes certain tests by adding ORDER BY clause in tests and remember that I saw the same error in tablespaces test for creation of partitioned index. It comes very rarely and test fails on inverted order of parent and child.PFA small patch that stabilizes that test in the same style by adding ORDER BY.
+1 and the patch looks good to me.
I think we also need to add ORDER BY clauses to a few more tests(as
pointed in [1]/messages/by-id/CALj2ACVb+FsKAhxAmVWSnTsPQwkvbMsxo4jGhw3uT-E036hvPA@mail.gmail.com) in create_function_3.sql which the commit 7e3c54168
missed to add. I will post the patch there in [1]/messages/by-id/CALj2ACVb+FsKAhxAmVWSnTsPQwkvbMsxo4jGhw3uT-E036hvPA@mail.gmail.com and see if it gets
picked up.
[1]: /messages/by-id/CALj2ACVb+FsKAhxAmVWSnTsPQwkvbMsxo4jGhw3uT-E036hvPA@mail.gmail.com
With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com
I noticed the Peter's commit 7e3c54168d9ec058cb3c9d47f8105b1d32dc8ceb
that stabilizes certain tests by adding ORDER BY clause in tests and
remember that I saw the same error in tablespaces test for creation of
partitioned index. It comes very rarely and test fails on inverted order of
parent and child.PFA small patch that stabilizes that test in the same style by adding
ORDER BY.
+1 and the patch looks good to me.
I think we also need to add ORDER BY clauses to a few more tests(as
pointed in [1]) in create_function_3.sql which the commit 7e3c54168
missed to add. I will post the patch there in [1] and see if it gets
picked up.
Thanks! I think the patch you mentioned in [1] is also good, and it's worth
being committed as well.
--
Best regards,
Pavel Borisov
Postgres Professional: http://postgrespro.com <http://www.postgrespro.com>