Re: incorrect xlog.c coverage report - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: incorrect xlog.c coverage report
Date
Msg-id CAD21AoAk3526uVb+9Js_XaMYeMF34YiG+SefRY9-Npq+foPsPQ@mail.gmail.com
Whole thread Raw
In response to Re: incorrect xlog.c coverage report  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: incorrect xlog.c coverage report
List pgsql-hackers
On Wed, Nov 21, 2018 at 12:50 AM Alvaro Herrera
<alvherre@2ndquadrant.com> 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 looked into this issue and this happens on my environment (CentOS
6.9 and gcob 4.4.7) as well. ISTM the cause would related to the
immediate shutdown mode we're using in test_recovery_standby.
Interestingly in my environment with the attached one-line patch the
coverage reports the branches parsing the individual recovery options
correctly.

If my investigation is correct, all tests where use an immediate
shutdown might not counted by gcov.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: A WalSnd issue related to state WALSNDSTATE_STOPPING
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] proposal: schema variables