Skip to content

Commit

Permalink
CI: deconflict fixed test ports
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed Nov 27, 2024
1 parent 5aa6eda commit 02f9d03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test_nginx.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ def get(self, path):
@pytest.mark.parametrize("ssl", [False, True], ids=["plain", "ssl"])
@pytest.mark.parametrize("worker_class", TEST_SIMPLE)
def test_nginx_proxy(*, ssl, worker_class, dummy_ssl_cert, read_size=1024):
# avoid ports <= 6144 which may be in use by CI runner
# avoid ports <= 6178 which may be in use by CI runner
# avoid quickly reusing ports as they might not be cleared immediately on BSD
worker_index = WORKER_ORDER.index(worker_class)
fixed_port = 1024 * 6 + (2 if ssl else 0) + (4 * worker_index)
fixed_port = 6178 + 512 + (2 if ssl else 0) + (4 * worker_index)
# FIXME: should also test inherited socket (LISTEN_FDS)
# FIXME: should also test non-inherited (named) UNIX socket
gunicorn_bind = "[::1]:%d" % fixed_port
Expand Down
4 changes: 2 additions & 2 deletions tests/test_wrk.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ def test_wrk(*, ssl, worker_class, dummy_ssl_cert, read_size=1024):
if worker_class == "eventlet" and ssl:
pytest.skip("eventlet worker does not catch errors in ssl.wrap_socket")

# avoid ports <= 6144 which may be in use by CI runne
# avoid ports <= 6178 which may be in use by CI runne
worker_index = WORKER_ORDER.index(worker_class)
fixed_port = 1024 * 6 + 1024 + (2 if ssl else 0) + (4 * worker_index)
fixed_port = 6178 + 1024 + (2 if ssl else 0) + (4 * worker_index)
# FIXME: should also test inherited socket (LISTEN_FDS)
# FIXME: should also test non-inherited (named) UNIX socket
gunicorn_bind = "[::1]:%d" % fixed_port
Expand Down

0 comments on commit 02f9d03

Please sign in to comment.