[check_postgres] failure of make test in

Kevin Brannen KBrannen at efji.com
Fri Jul 7 19:45:57 UTC 2017


Christoph,

My apologies for not including a patch for the other file. I didn't even think about fixing it until after I sent you the other email. Here's what works on my server:

$ git diff
diff --git a/t/01_validate_range.t b/t/01_validate_range.t
index 849a0b3..f387197 100644
--- a/t/01_validate_range.t
+++ b/t/01_validate_range.t
@@ -147,16 +147,16 @@ SIZE: {
         critical => '42 exobytes'
     );
     ($w, $c) = check_postgres::validate_range({ type => 'size' });
-    is $w, 1.15292150460685e+18, 'Should have warning == 1 exobytes';
-    is $c, 4.84227031934876e+19, 'Should have critical == 42 exobytes';
+    is $w, 0+1024**6, 'Should have warning == 1 exobytes';
+    is $c, 42*1024**6, 'Should have critical == 42 exobytes';

     %check_postgres::opt = (
         warning  => '1z',
         critical => '42 zettabytes'
     );
     ($w, $c) = check_postgres::validate_range({ type => 'size' });
-    is $w, 1.18059162071741e+21, 'Should have warning == 1 zettabytes';
-    is $c, 4.95848480701313e+22, 'Should have critical == 42 zettaytes';
+    is $w, 0+1024**7, 'Should have warning == 1 zettabytes';
+    is $c, 42*1024**7, 'Should have critical == 42 zettaytes';
 }

 INTEGER: {

For reasons I don't quite understand, I had to do "0+1024**6", without the addition trick then the value goes into scientific notation, which causes the check to fail. With the addition, then it stays as a whole integer. Zettabytes does not need that as it's always too big and so always goes into scientific notation, but I left it there for consistency.

Sigh, I was about to tell you that it's all good now, but it's not. Now I have:

t/02_same_schema.t ......... 74/76 # Looks like you failed 70 tests of 76.
t/02_same_schema.t ......... Dubious, test returned 70 (wstat 17920, 0x4600)
Failed 70/76 subtests

Details look like:

$ perl t/02_same_schema.t
1..76
sh: warning: setlocale: LC_ALL: cannot change locale (en): No such file or directory
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en): No such file or directory
sh: warning: setlocale: LC_ALL: cannot change locale (en): No such file or directory
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en): No such file or directory
Creating new symlink socket at /tmp/cptesting_socket2
sh: warning: setlocale: LC_ALL: cannot change locale (en): No such file or directory
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en): No such file or directory
Creating new symlink socket at /tmp/cptesting_socket3
ok 1 - Action 'same_schema' fails when called with an invalid option
not ok 2 - Action 'same_schema' succeeds with two empty databases
#   Failed test 'Action 'same_schema' succeeds with two empty databases'
#   at t/02_same_schema.t line 65.
#                   'POSTGRES_SAME_SCHEMA CRITICAL: DB "postgres" (hosts:/tmp/cptesting_socket,/tmp/cptesting_socket2) Databases were different. Items not matched: 1 | time=0.22s
# DB 1: dbservice= port=5432 host=/tmp/cptesting_socket dbname=postgres user=check_postgres_testing
# DB 1: PG version: 9.5.1
# DB 1: Total objects: 15
# DB 2: dbservice= port=5432 host=/tmp/cptesting_socket2 dbname=postgres user=check_postgres_testing
# DB 2: PG version: 9.5.1
# DB 2: Total objects: 15
# User "powerless_pete":
#   "useconfig":
#     "search_path" is not set on all databases:
#       Exists on:  1
#       Missing on: 2
#
# '
#     doesn't match '(?^:^POSTGRES_SAME_SCHEMA OK)'
not ok 3 - Action 'same_schema' reports on language differences
#   Failed test 'Action 'same_schema' reports on language differences'
#   at t/02_same_schema.t line 97.
#                   'POSTGRES_SAME_SCHEMA CRITICAL: DB "postgres" (hosts:/tmp/cptesting_socket,/tmp/cptesting_socket2,/tmp/cptesting_socket3) Databases were different. Items not matched: 1 | time=0.35s
# DB 1: dbservice= port=5432 host=/tmp/cptesting_socket dbname=postgres user=check_postgres_testing
# DB 1: PG version: 9.5.1
# DB 1: Total objects: 14
# DB 2: dbservice= port=5432 host=/tmp/cptesting_socket2 dbname=postgres user=check_postgres_testing
# DB 2: PG version: 9.5.1
# DB 2: Total objects: 14
# DB 3: dbservice= port=5432 host=/tmp/cptesting_socket3 dbname=postgres user=check_postgres_testing
# DB 3: PG version: 9.5.1
# DB 3: Total objects: 14
# User "powerless_pete":
#   "useconfig":
#     "search_path" is not set on all databases:
#       Exists on:  1
#       Missing on: 2, 3
#
# '
#     doesn't match '(?^:^POSTGRES_SAME_SCHEMA OK)'

And so on and so on for 73 more tests. Based on the error, are you assuming that "search_path" won't be set? If so, then you need to unset it or set it to what you need for the session only. I'd offer a patch but I'm not sure what the test program is expecting.

HTH,
Kevin

This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.



More information about the Check_postgres mailing list