Re: incorrect xlog.c coverage report

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: incorrect xlog.c coverage report
Date: 2018-11-20 12:02:03
Message-ID: 20181120120203.enpga2mfkxrzgymt@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Nov-20, Peter Eisentraut wrote:

> I noticed some strangeness in the test coverage reporting. For example,
> in
> https://coverage.postgresql.org/src/backend/access/transam/xlog.c.gcov.html
> in the function readRecoveryCommandFile(), most of the branches parsing
> the individual recovery options (recovery_target_xid,
> recovery_target_time, etc.) are shown as never hit, even though there
> are explicit tests for this in
> src/test/recovery/t/003_recovery_targets.pl. I tried this locally and
> also with -O0 just in case, but I get the same results. Any ideas?

I've posted this before, but as a reminder, the coverage script does this:

./configure --enable-depend --enable-coverage --enable-tap-tests --enable-nls --with-python --with-perl --with-tcl --with-openssl --with-libxml --with-ldap --with-pam >> $LOG 2>&1

# run tests
make -j4 >> $LOG 2>&1
make -j4 -C contrib >> $LOG 2>&1
make check-world PG_TEST_EXTRA="ssl ldap" >> $LOG 2>&1
make coverage-html >> $LOG 2>&1

I certainly expect that this would run the recovery test. And today's log
file has this:

make -C recovery check
make[2]: Entering directory '/home/coverage/pgsrc/pgsql/src/test/recovery'
for extra in contrib/test_decoding; do make -C '../../..'/$extra DESTDIR='/home/coverage/pgsrc/pgsql'/tmp_install install >>'/home/coverage/pgsrc/pgsql'/tmp_install/log/install.log || exit; done
rm -rf '/home/coverage/pgsrc/pgsql/src/test/recovery'/tmp_check
/bin/mkdir -p '/home/coverage/pgsrc/pgsql/src/test/recovery'/tmp_check
cd . && TESTDIR='/home/coverage/pgsrc/pgsql/src/test/recovery' PATH="/home/coverage/pgsrc/pgsql/tmp_install/usr/local/pgsql/bin:$PATH" LD_LIBRARY_PATH="/home/coverage/pgsrc/pgsql/tmp_install/usr/local/pgsql/lib" PGPORT='65432' PG_REGRESS='/home/coverage/pgsrc/pgsql/src/test/recovery/../../../src/test/regress/pg_regress' /usr/bin/prove -I ../../../src/test/perl/ -I . t/*.pl
t/001_stream_rep.pl .................. ok
t/002_archiving.pl ................... ok
t/003_recovery_targets.pl ............ ok
t/004_timeline_switch.pl ............. ok
t/005_replay_delay.pl ................ ok
t/006_logical_decoding.pl ............ ok
t/007_sync_rep.pl .................... ok
t/008_fsm_truncation.pl .............. ok
t/009_twophase.pl .................... ok
t/010_logical_decoding_timelines.pl .. ok
t/011_crash_recovery.pl .............. ok
t/012_subtransactions.pl ............. ok
t/013_crash_restart.pl ............... ok
t/014_unlogged_reinit.pl ............. ok
t/015_promotion_pages.pl ............. ok
All tests successful.
Files=15, Tests=140, 100 wallclock secs ( 0.08 usr 0.02 sys + 18.70 cusr 8.57 csys = 27.37 CPU)
Result: PASS
make[2]: Leaving directory '/home/coverage/pgsrc/pgsql/src/test/recovery'

Also:

$ cd src/backend/access/transam
$ ls -l xlog.*
-rw-r--r-- 1 coverage coverage 397975 Nov 19 06:01 xlog.c
-rw-r--r-- 1 coverage coverage 34236 Nov 20 09:20 xlog.gcda
-rw-r--r-- 1 coverage coverage 257868 Nov 20 09:02 xlog.gcno
-rw-r--r-- 1 coverage coverage 527576 Nov 20 09:02 xlog.o

Not sure what to make of this.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-11-20 12:33:59 Re: wal_dump output on CREATE DATABASE
Previous Message Jung, Jinho 2018-11-20 11:47:25 Re: Regarding performance regression on specific query