Module: check_mk
Branch: master
Commit: 28c2567f883184ab35e721ce0c91857ace2b2d4e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=28c2567f883184…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 7 14:04:28 2017 +0100
mkbench: Fixed timing issue in cmc helper startup detection
Change-Id: Ief89a5a9a9c3255b97caca26112e0d0bed1c4968
---
bin/mkbench | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/bin/mkbench b/bin/mkbench
index e6d3cdf..23c6fc2 100755
--- a/bin/mkbench
+++ b/bin/mkbench
@@ -2946,12 +2946,18 @@ class TestAgentBasedStandardHosts(TestCase):
if num_not_ready == None:
self._test.info(" Waiting for helper initialization")
else:
- self._test.info(" Waiting for helper initialization (%d not
ready)" % num_not_ready)
+ self._test.info(" Waiting for helper initialization (%d not
ready)" %
+ num_not_ready)
+
+ try:
+ matched_pids = subprocess.check_output([
+ "pgrep", "-u", site_id(),
"-f", "python.*check_mk.py --keepalive$"]).split("\n")
+ except subprocess.CalledProcessError, e:
+ self._test.error(" Found no helper yet (%s)" % e.returncode)
+ continue
num_not_ready = 0
- for p in subprocess.check_output([
- "pgrep", "-u", site_id(), "-f",
"python.*check_mk.py --keepalive$"
- ]).split("\n"):
+ for p in matched_pids:
if p and not os.path.exists("/proc/%s/fd/3" % p):
num_not_ready += 1
time.sleep(1)