Skip to content

Commit

Permalink
fix natlab parity when setting ephemeral ports
Browse files Browse the repository at this point in the history
  • Loading branch information
gytsto committed Dec 9, 2024
1 parent c60eede commit a49f8be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Empty file added .unreleased/fix_port_parity
Empty file.
5 changes: 5 additions & 0 deletions nat-lab/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ async def on_output(output: str) -> None:
print(datetime.now(), f"os_ephemeral_ports_{vm_tag}: {output}")

start_port = random.randint(5000, 55000)
if start_port % 2:
start_port += 1
num_ports = random.randint(2000, 5000)
if num_ports % 2:
num_ports += 1

print(
datetime.now(),
f"Setting up ports for {vm_tag}: start={start_port}, num={num_ports}",
Expand Down

0 comments on commit a49f8be

Please sign in to comment.