pgsql: Improve contrib/bloom regression test using code coverage info. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Improve contrib/bloom regression test using code coverage info.
Date
Msg-id E1apIuZ-0006yx-8F@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Improve contrib/bloom regression test using code coverage info.

Originally, this test created a 100000-row test table, which made it
run rather slowly compared to other contrib tests.  Investigation with
gcov showed that we got no further improvement in code coverage after
the first 700 or so rows, making the large table 99% a waste of time.
Cut it back to 2000 rows to fix the runtime problem and still leave
some headroom for testing behaviors that may appear later.

A closer look at the gcov results showed that the main coverage
omissions in contrib/bloom occurred because the test never filled more
than one entry in the notFullPage array; which is unsurprising because
it exercised index cleanup only in the scenario of complete table
deletion, allowing every page in the index to become deleted rather
than not-full.  Add testing that allows the not-full path to be
exercised as well.

Also, test the amvalidate function, because blvalidate.c had zero
coverage without that, and besides it's a good idea to check for
mistakes in the bloom opclass definitions.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/cf223c3bf5ba16232147c66b5fef4037aafe747c

Modified Files
--------------
contrib/bloom/expected/bloom.out | 60 ++++++++++++++++++++++++++++++----------
contrib/bloom/sql/bloom.sql      | 18 ++++++++++--
2 files changed, 62 insertions(+), 16 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Add the "snapshot too old" feature
Next
From: Andres Freund
Date:
Subject: pgsql: Avoid the use of a separate spinlock to protect a LWLock's wait