call more robust
Message-ID: <5c797a4c.U5y2wJOJzujXHEhX%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 5d78af277775034aaeddb98113867f435d80b5b5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d78af27777503…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 1 19:24:47 2019 +0100
Tests: Made config reload check after site.activate_changes() call more robust
Change-Id: Ic43bf9f5e5408c168ea2fe5ee36640bfe7358b89
---
tests/testlib/__init__.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index ca39b11..633f318 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -1636,7 +1636,14 @@ class CMKWebSession(WebSession):
# core restart/reload, so e.g. querying a Livestatus table immediately
# might not reflect the changes yet. Ask the core for a successful reload.
def config_reloaded():
- new_t = self.site.live.query_value("GET status\nColumns:
program_start\n")
+ import livestatus
+ try:
+ new_t = self.site.live.query_value("GET status\nColumns:
program_start\n")
+ except livestatus.MKLivestatusException:
+ # Seems like the socket may vanish for a short time. Keep waiting in
case
+ # of livestatus (connection) issues...
+ return False
+
return new_t > old_t
reload_time, timeout = time.time(), 10