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
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; }