Commit 031284b0 by Jérome Perrin

erp5/test: give more time for ERP5 to be ready

now that promises are satisfied, we don't retry slapos node instance
again and again, so this test starts earlier and we need to wait longer
for ERP5 to be ready.

Also tolerate that this 503 can be 404 (I think this happened a few time
on test nodes in the past)
parent 7a988a85
......@@ -47,12 +47,14 @@ class TestPublishedURLIsReachableMixin(object):
# What happens is that instanciation just create the services, but does not
# wait for ERP5 to be initialized. When this test run ERP5 instance is
# instanciated, but zope is still busy creating the site and haproxy replies
# with 503 Service Unavailable.
# with 503 Service Unavailable, sometimes the first request is 404, so we
# retry in a loop.
# If we can move the "create site" in slapos node instance, then this retry loop
# would not be necessary.
for i in range(1, 20):
r = requests.get(url, verify=False) # XXX can we get CA from caucase already ?
if r.status_code == requests.codes.service_unavailable:
for i in range(1, 60):
r = requests.get(url, verify=False) # XXX can we get CA from caucase already ?
if r.status_code in (requests.codes.service_unavailable,
requests.codes.not_found):
delay = i * 2
self.logger.warn("ERP5 was not available, sleeping for %ds and retrying", delay)
time.sleep(delay)
......
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 sign in to comment