Module: check_mk
Branch: master
Commit: 96496bd6cbe8ef69de23b117d1670f2d382521ee
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96496bd6cbe8ef…
Author: Florian Kromer <fk(a)mathias-kettner.de>
Date: Mon May 6 12:46:10 2019 +0200
oracle_dataguard_stats: Fix flaky test by making infotext order deterministic
Change-Id: Id9d74f4d0a130e2482c49e167c3488ed9a271e40
---
checks/oracle_dataguard_stats | 2 +-
.../checks/generictests/datasets/oracle_dataguard_stats.py | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/checks/oracle_dataguard_stats b/checks/oracle_dataguard_stats
index 272328d..971b705 100644
--- a/checks/oracle_dataguard_stats
+++ b/checks/oracle_dataguard_stats
@@ -160,7 +160,7 @@ def check_oracle_dataguard_stats(item, params, parsed):
else:
yield 2, "Managed Recovery Process not started"
- for dgstat_param in dgdata['dgstat'].keys():
+ for dgstat_param in sorted(dgdata['dgstat'].keys()):
if dgstat_param in ('apply lag', 'transport lag') and
dgdata['dgstat'][dgstat_param]:
seconds = get_seconds(dgdata['dgstat'][dgstat_param])
diff --git a/tests/unit/checks/generictests/datasets/oracle_dataguard_stats.py
b/tests/unit/checks/generictests/datasets/oracle_dataguard_stats.py
index 951596d..82151bc 100644
--- a/tests/unit/checks/generictests/datasets/oracle_dataguard_stats.py
+++ b/tests/unit/checks/generictests/datasets/oracle_dataguard_stats.py
@@ -37,13 +37,15 @@ checks = {'': [('TESTDB.TESTDBU2',
(0, 'Broker maximum', [])]),
('TUX12C.TUXSTDB',
{'apply_lag': (3600, 14400)},
- [(0, 'Database Role physical standby', []),
+ [
+ (0, 'Database Role physical standby', []),
(0,
'apply finish time 17.0 s',
[('apply_finish_time', 17, None, None, None, None)]),
(0,
+ 'apply lag 28 m',
+ [('apply_lag', 1737, 3600, 14400, None, None)]),
+ (0,
'transport lag 0.00 s',
[('transport_lag', 0, None, None, None, None)]),
- (0,
- 'apply lag 28 m',
- [('apply_lag', 1737, 3600, 14400, None, None)])])]}
\ No newline at end of file
+])]}