Module: check_mk
Branch: master
Commit: 10a7937409e01cf13b52ca4e9bf299111da43b45
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=10a7937409e01c…
Author: Alex Zurhake <az(a)mathias-kettner.de>
Date: Mon Mar 4 12:14:41 2019 +0100
The code was not race condition safe. Added a try block to not fail for OSError 2
Change-Id: Ie99d83df49e8fb3f2a541e1a69c49da7c9bc4b06
---
.../integration/notifications/test_unreachable_notifications.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/integration/notifications/test_unreachable_notifications.py
b/tests/integration/notifications/test_unreachable_notifications.py
index cc440c9..8cd4623 100644
--- a/tests/integration/notifications/test_unreachable_notifications.py
+++ b/tests/integration/notifications/test_unreachable_notifications.py
@@ -117,8 +117,13 @@ def initial_state(site, scenario):
site.live.command("[%d] ROTATE_LOGFILE" % time.time())
def rotated_log():
- return os.path.exists(site.path("var/check_mk/core/history")) \
- and inode_before !=
os.stat(site.path("var/check_mk/core/history")).st_ino
+ try:
+ return inode_before !=
os.stat(site.path("var/check_mk/core/history")).st_ino
+ except OSError as e:
+ if e.errno == 2:
+ return False
+ else:
+ raise e
wait_until(rotated_log, timeout=10)
else: