align check_wal_files() code with it's test case #184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test 02_wal_files.t may fail against a newly created (by the framework
in CP_Testing.pm) database (PostgreSQL 13) with
: Failed test 'Action 'wal_files' works as expected for warnings'
: at t/02_wal_files.t line 44.
: 'POSTGRES_WAL_FILES OK: DB "postgres" (host:/tmp/cptesting_socket) WAL files found: 1 | time=0.01s files=1;1
: '
: doesn't match '(?^:^POSTGRES_WAL_FILES WARNING)'
as there is exactly one WAL file and the test expects the check to raise
warning/critical alerts at one WAL file - just as the documentation of
the alert levels says "the threshold at wich a warning/critical alert is
fired", but the code in check_wal_files() checks if the number of files
is greater than the alerting threshold. Admitted that this is a corner
case, but it is annoying af when running the tests.
Fix by converting the greater '>' into 'greater-or-equal' '>=' checks.