We have to use disjoint port ranges for individual test, otherwise
parallel test execution leads to unpredictable results.
local bound
for _ = 1,1000 do
- bound = net.listen('127.0.0.1', math.random(1025,65535), { kind = 'webtest'} )
+ bound = net.listen('127.0.0.1', math.random(20000, 29999), { kind = 'webtest'} )
if bound then
break
end
local bound
for _ = 1,1000 do
- bound = net.listen('127.0.0.1', math.random(1025,65535), { kind = 'doh'} )
+ bound = net.listen('127.0.0.1', math.random(30000, 39999), { kind = 'doh'} )
if bound then
break
end