From: MasaoFujii Date: Sat, 15 Feb 2020 14:16:02 +0000 (+0900) Subject: Stabilize the result of pg_gin_pending_stats() regression test. X-Git-Url: http://git.sourceforge.jp/view?p=pgbigm%2Fpg_bigm.git;a=commitdiff_plain;h=9f43139fd655a21a16df5e166a5627c573345f5a Stabilize the result of pg_gin_pending_stats() regression test. Previously pg_bigm regression test checked the value of pages column that pg_gin_pending_stats() returns. But this value could vary from block size to block size in PostgreSQL server. This leaded to unexpected failure of regression test on PostgreSQL built with non-default block size. To avoid this issue, this patch gets rid of the check for pages column from the regression test, to stabilize the result of test whatever block size is used. The value of pages column that pg_gin_pending_stats() is calculated in PostgreSQL server side, so there is no strong reason why pg_bigm regression test needs to verify the value and we determined that it's ok to get rid of that check. Back-patch to pg_bigm 1.1 where regression test for pg_gin_pending_stats() was added. Author: Torikoshi Atsushi Reviewed-by: Fujii Masao Discussion: https://osdn.net/projects/pgbigm/lists/archive/hackers/2020-February/000331.html --- diff --git a/expected/pg_bigm.out b/expected/pg_bigm.out index f17b715..66eda39 100644 --- a/expected/pg_bigm.out +++ b/expected/pg_bigm.out @@ -103,10 +103,13 @@ CREATE INDEX test_bigm_idx ON test_bigm USING gin (col1 gin_bigm_ops, col2 gin_bigm_ops); \copy test_bigm from 'data/bigm.csv' with csv -- tests pg_gin_pending_stats -SELECT * FROM pg_gin_pending_stats('test_bigm_idx'); - pages | tuples --------+-------- - 43 | 249 +-- exclude pages column from the return values of only this call of +-- pg_gin_pending_stats(), in order to stabilize the result of +-- this regression test whatever block size is used in PostgreSQL server. +SELECT tuples FROM pg_gin_pending_stats('test_bigm_idx'); + tuples +-------- + 249 (1 row) VACUUM; diff --git a/sql/pg_bigm.sql b/sql/pg_bigm.sql index 10daab8..6df074b 100644 --- a/sql/pg_bigm.sql +++ b/sql/pg_bigm.sql @@ -41,7 +41,11 @@ CREATE INDEX test_bigm_idx ON test_bigm \copy test_bigm from 'data/bigm.csv' with csv -- tests pg_gin_pending_stats -SELECT * FROM pg_gin_pending_stats('test_bigm_idx'); + +-- exclude pages column from the return values of only this call of +-- pg_gin_pending_stats(), in order to stabilize the result of +-- this regression test whatever block size is used in PostgreSQL server. +SELECT tuples FROM pg_gin_pending_stats('test_bigm_idx'); VACUUM; SELECT * FROM pg_gin_pending_stats('test_bigm_idx'); SELECT * FROM pg_gin_pending_stats('test_bigm');