pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: gcov coverage data not full with immediate stop
Date: Sun, 10 May 2020 19:00:00 +0300
Message-ID: <816a4de5-3f15-4d66-1ec1-791cab2ca6df@gmail.com> (raw)

Hello hackers,

I've found that gcov coverage data miss some information when a postgres
node stopped in 'immediate' mode.
For example, on the master branch:
make coverage-clean; time make check -C src/test/recovery/; make
coverage-html
generates a coverage report with 106193 lines/6318 functions for me
(`make check` takes 1m34s).
But with the attached simple patch I get a coverage report with 106540
lines/6332 functions (and `make check` takes 2m5s).
(IMO, the slowdown of the test is significant.)

So if we want to make the coverage reports more precise, I see the three
ways:
1. Change the stop mode in teardown_node to fast (probably only when
configured with --enable-coverage);
2. Explicitly stop nodes in TAP tests (where it's important) -- seems
too tedious and troublesome;
3. Explicitly call __gcov_flush in SIGQUIT handler (quickdie)?

Best regards,
Alexander

Attachments:

pgnode-stop.patch (text/x-patch, 309B) download diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index af13c320e9c..99c1e85e1a3 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -1242,7 +1242,7 @@ sub teardown_node { my $self = shift; - $self->stop('immediate'); + $self->stop(); return; }

view thread (12+ messages)  latest in thread

Message-ID: <816a4de5-3f15-4d66-1ec1-791cab2ca6df@gmail.com>
Permalink:  ../816a4de5-3f15-4d66-1ec1-791cab2ca6df@gmail.com/
Also on:    postgresql.org/message-id/816a4de5-3f15-4d66-1ec1-791cab2ca6df@gmail.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com
  Subject: Re: gcov coverage data not full with immediate stop
  In-Reply-To: <816a4de5-3f15-4d66-1ec1-791cab2ca6df@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox