mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 08:05:21 +00:00
Fix base_port calculation in pytest runner
The selected base port should be in the range <port_min, port_max), the formula was incorrect. Credit for discovering this fault goes to Ondrej Sury.
This commit is contained in:
@@ -312,7 +312,7 @@ else:
|
|||||||
# worker threads, multiple tests may have same port values assigned. If
|
# worker threads, multiple tests may have same port values assigned. If
|
||||||
# these tests are then executed simultaneously, the test results will
|
# these tests are then executed simultaneously, the test results will
|
||||||
# be misleading.
|
# be misleading.
|
||||||
base_port = int(time.time() // 3600) % (port_max - port_min)
|
base_port = int(time.time() // 3600) % (port_max - port_min) + port_min
|
||||||
|
|
||||||
return {mod: base_port + i * PORTS_PER_TEST for i, mod in enumerate(modules)}
|
return {mod: base_port + i * PORTS_PER_TEST for i, mod in enumerate(modules)}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user