]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
http: fix parallel execution of HTTP tests with SO_REUSEPORT
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 9 Oct 2019 12:35:53 +0000 (14:35 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Wed, 9 Oct 2019 12:39:16 +0000 (14:39 +0200)
We have to use disjoint port ranges for individual test, otherwise
parallel test execution leads to unpredictable results.

modules/http/http.test.lua
modules/http/http_doh.test.lua

index 968de3b1d70dc1d2448e3a339a3b0b6c9588bc7f..0422c2d22d9eb3472f0d1444334ca82d00728183 100644 (file)
@@ -20,7 +20,7 @@ else
 
        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
index 480df3a1b0d6d4f16db03e0544f40770a48c7538..467713eb63e9ebfc4bda42935dedfaa6fccc20ac 100644 (file)
@@ -88,7 +88,7 @@ else
 
        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