OSDN Git Service

Stabilize the result of pg_gin_pending_stats() regression test.
authorMasaoFujii <masao.fujii@gmail.com>
Sat, 15 Feb 2020 14:16:02 +0000 (23:16 +0900)
committerMasaoFujii <masao.fujii@gmail.com>
Sat, 15 Feb 2020 14:35:02 +0000 (23:35 +0900)
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

expected/pg_bigm.out
sql/pg_bigm.sql

index f17b715..66eda39 100644 (file)
@@ -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;
index 10daab8..6df074b 100644 (file)
@@ -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');