Commit 19b3a67d authored by Arnaud Fontaine's avatar Arnaud Fontaine

runUnitTest: Test the full ports range as some tests require Zope to listen on...

runUnitTest: Test the full ports range as some tests require Zope to listen on a port (testShaDir...).

With erp5testnode, many tests are running concurrently on the same machine and
only 3 ports were randomly tested before continuing and thus not listening to
any port. Moreover, checking the full range (500 ports) takes less than 1ms...
parent fd9219af
......@@ -306,12 +306,11 @@ def parseListeningAddress(host_port=None, default_host='127.0.0.1'):
raise RuntimeError("Can't bind to %s:%s" % host_port)
except ValueError:
default_host = host_port[1]
port_list = []
for i in xrange(3):
port_list.append(instance_random.randint(55000, 55500))
yield default_host, port_list[-1]
raise RuntimeError("Can't find free port (tried ports %s)\n"
% ', '.join(map(str, port_list)))
for port in xrange(55000, 55500):
yield default_host, port
raise RuntimeError("Can't find free port (tried ports 55000 to 55500)")
def createZServer(log=os.devnull, zserver_type='http'):
import ZServer
......
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