Test stabilization for online checksums

Postcommit review and buildfarm/CI failures revealed a few issues in
the test code which this commit attempts to resolve.  These failures
are verified using synthetic means.

  * Wait for launcher exit in enable/disable checksum tests

    When enabling or disabling data checksums in a test with waiting
    for an end state (on or off), the test typically want to perform
    more test against the cluster immediately. Make sure to wait for
    the launcher to exit in these cases before returning in order to
    know it can immediately be acted on.  This is a more generic way
    of implementating 0036232ba8f.

  * Refactor injection point tests to use the injection_points test
    extension. Two injection points added for online checksums were
    better expressed using the injection_points extension with the
    test code embedded in datachecksum_state.c.

  * Make tests less timing dependent and allow transitions to "on"
    and not just "inprogress-on" in case a test manages to finish
    before it's checked for state.

  * When waiting on a blocking background psql keeping a temporary
    table open, the test first closed the background session abd
    then the server.  This could cause data checksums to manage to
    get enabled in the brief window between dropping the temporary
    table and closing the server.  Fix by closing the server first
    before the background session.

  * Remove a few superfluous duplicate checks and general cleanup
    of comments as well as making LSN logging consistent.

These issues were reported by Andres as well as spotted in the
buildfarm and on CI.

Author: Daniel Gustafsson <[email protected]>
Reported-by: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/07009121c235dc1b9338b57b6a85006a5e3b0bd8

Modified Files
--------------
src/backend/postmaster/datachecksum_state.c        | 26 ++++++-
src/test/modules/test_checksums/t/001_basic.pl     |  6 +-
.../test_checksums/t/003_standby_restarts.pl       | 14 ++--
src/test/modules/test_checksums/t/004_offline.pl   |  8 ++-
src/test/modules/test_checksums/t/005_injection.pl | 12 +++-
.../modules/test_checksums/t/006_pgbench_single.pl | 16 ++++-
.../test_checksums/t/007_pgbench_standby.pl        | 19 ++++--
src/test/modules/test_checksums/t/008_pitr.pl      |  8 +--
.../test_checksums/t/DataChecksums/Utils.pm        | 24 ++++++-
.../modules/test_checksums/test_checksums--1.0.sql |  8 ---
src/test/modules/test_checksums/test_checksums.c   | 79 ----------------------
11 files changed, 101 insertions(+), 119 deletions(-)

Reply via email to