Commit f4d3ac63 authored by Łukasz Nowak's avatar Łukasz Nowak

test: Give more time for servers to start

Also improve message in case of failure.
parent c89c31a5
...@@ -157,8 +157,9 @@ class KedifaMixinCaucase(KedifaMixin): ...@@ -157,8 +157,9 @@ class KedifaMixinCaucase(KedifaMixin):
self.caucase_runtime.start() self.caucase_runtime.start()
self.assertTrue(self.caucase_runtime.is_alive()) self.assertTrue(self.caucase_runtime.is_alive())
self.caucase_url = 'http://[%s]:%s' % (ip, port) self.caucase_url = 'http://[%s]:%s' % (ip, port)
# give some time for caucase to be available # give 5s for caucase to be available
for i in range(20): b = time.time()
for i in range(50):
try: try:
requests.get(self.caucase_url) requests.get(self.caucase_url)
except BaseException: except BaseException:
...@@ -167,7 +168,8 @@ class KedifaMixinCaucase(KedifaMixin): ...@@ -167,7 +168,8 @@ class KedifaMixinCaucase(KedifaMixin):
else: else:
break break
else: else:
raise self.fail(
'Caucase not available after %.2fs seconds' % (time.time() - b))
def setUpKey(self, common_name): def setUpKey(self, common_name):
# create key for the service and keep its downloaded ca_crt # create key for the service and keep its downloaded ca_crt
...@@ -230,8 +232,9 @@ class KedifaMixinCaucase(KedifaMixin): ...@@ -230,8 +232,9 @@ class KedifaMixinCaucase(KedifaMixin):
self.kedifa_runtime.start() self.kedifa_runtime.start()
self.assertTrue(self.kedifa_runtime.is_alive()) self.assertTrue(self.kedifa_runtime.is_alive())
# give some time for KeDiFa to be available # give 5s for KeDiFa to be available
for i in range(5): b = time.time()
for i in range(50):
try: try:
self.requests_get(self.kedifa_url + 'ping') self.requests_get(self.kedifa_url + 'ping')
except BaseException: except BaseException:
...@@ -239,7 +242,8 @@ class KedifaMixinCaucase(KedifaMixin): ...@@ -239,7 +242,8 @@ class KedifaMixinCaucase(KedifaMixin):
else: else:
break break
else: else:
raise self.fail(
'Kedifa not available after %.2fs seconds' % (time.time() - b))
def reserveReference(self, *args, **kwargs): def reserveReference(self, *args, **kwargs):
result = requests.post( result = requests.post(
......
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