Commit 48f41aa8 authored by Łukasz Nowak's avatar Łukasz Nowak

rapid-cdn: c->h: Wait for the long entry to appear

parent d3f0ae25
...@@ -1442,10 +1442,16 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase): ...@@ -1442,10 +1442,16 @@ class SlaveHttpFrontendTestCase(HttpFrontendTestCase):
self.instance_path, '*', 'var', 'log', 'httpd', log_name self.instance_path, '*', 'var', 'log', 'httpd', log_name
))[0] ))[0]
with open(log_file) as fh: # sometimes logs appear with a bit of delay, so give it a chance
self.assertRegex( for _ in range(5):
fh.readlines()[-1], with open(log_file, 'r') as fh:
log_regexp) line = fh.readlines()[-1]
if re.match(log_regexp, line):
break
time.sleep(0.5)
self.assertRegex(
line,
log_regexp)
class TestMasterRequestDomain(HttpFrontendTestCase, TestDataMixin): class TestMasterRequestDomain(HttpFrontendTestCase, TestDataMixin):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment