2
0
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:
Tom Krizek
2023-05-30 14:11:14 +02:00
parent 7b35586047
commit e8ea6b610b

View File

@@ -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)}