diff options
author | Christoph Berg | 2013-09-18 15:04:38 +0000 |
---|---|---|
committer | Christoph Berg | 2013-09-18 15:04:38 +0000 |
commit | be94dd08375adc0fd1747e3f9dd556b363ee4c28 (patch) | |
tree | 77029fc975551135338e51ef8b9fbb6c3b5c63d5 | |
parent | 927f4aa3f76431cea820ab69c66a3bc95af159f7 (diff) |
Sort lock types so the output ordering is predicatable
-rwxr-xr-x | check_postgres.pl | 2 | ||||
-rw-r--r-- | t/02_locks.t | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/check_postgres.pl b/check_postgres.pl index b7c8417d0..5de33d524 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -5131,7 +5131,7 @@ sub check_locks { ## If not specific errors, just use the total my $ok = 1; - for my $type (keys %totallock) { + for my $type (sort keys %totallock) { if ($critical and exists $critical->{$type} and $totallock{$type} >= $critical->{$type}) { ($type eq 'total') ? add_critical msg('locks-msg2', $totallock{total}) diff --git a/t/02_locks.t b/t/02_locks.t index 0f497c1b9..0765f75b5 100644 --- a/t/02_locks.t +++ b/t/02_locks.t @@ -71,7 +71,7 @@ like ($cp->run('--warning="waiting=1"'), qr{^$label WARNING.*total "waiting" loc $t=qq{$S returns correct multiple item output}; like ($cp->run('--warning="waiting=1;exclusive=2"'), - qr{^$label WARNING.*total "waiting" locks: 1 \* total "exclusive" locks: 2 }, $t); + qr{^$label WARNING.*total "exclusive" locks: 2 \* total "waiting" locks: 1 }, $t); $cp->drop_schema_if_exists(); |