Commit f5639901 authored by Ivan Tyagov's avatar Ivan Tyagov

Fix testOooUnoMimemapper

Due to a5157949 cloudooo will retry 10 times before raising thus take this into account
Raise rather than swallow.

Test do pass at
https://nexedi.erp5.net/test_result_module/20191227-20A35E0F

/reviewed-on nexedi/cloudooo!21
parent a5157949
......@@ -22,11 +22,15 @@ def getServiceManager(host, port, uno_path, office_binary_path):
# Connect to the running OpenOffice.org and get its
# context.
# Retry 10 times if needed.
for i in range(10):
max_attempts = 10
for i in range(max_attempts):
try:
uno_connection = resolver.resolve("uno:socket,host=%s,port=%s;urp;StarOffice.ComponentContext" % (host, port))
break
except:
if i == (max_attempts - 1):
# no use to try, raise accordingly rather than swallow exception
raise
# I don't know how to import com.sun.star.connection.NoConnectException
time.sleep(1)
# Get the ServiceManager object
......
......@@ -110,9 +110,12 @@ class TestUnoMimeMapper(HandlerTestCase):
"--office_binary_path=%s" % self.office_binary_path,
"--hostname=%s" % self.hostname,
"--port=%s" % self.openoffice_port]
stdout, stderr = Popen(command,
stdout=PIPE,
stderr=PIPE).communicate()
# due to a5157949fb5fc9e0c4b0b204f0e737c15498cf38
# cloudooo will retry 10 times before raising thus take this into account
for i in range(10):
stdout, stderr = Popen(command,
stdout=PIPE,
stderr=PIPE).communicate()
self.assertEquals(stdout, '')
self.assertTrue(stderr.endswith(error_msg), stderr)
openoffice.start()
......
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