Skip to content

Commit

Permalink
test unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Oct 1, 2024
1 parent 77a4a23 commit d5a1f59
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/supervisors/test_multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,12 @@ def test_multiprocess_socket_balance() -> None: # pragma: py-darwin pragma: py-
supervisor.join_all()
min_conn, max_conn = sorted(d.values())
assert (max_conn - min_conn) < 25


def test_multiprocess_not_supported(monkeypatch):
monkeypatch.delattr(socket, "SO_REUSEPORT")
config = Config(app=app, workers=2, socket_load_balance=True, port=0, interface="asgi3")
with config.bind_socket() as sock:
supervisor = Multiprocess(config, target=run, sockets=[sock])
with pytest.raises(RuntimeError, match="socket_load_balance not supported"):
supervisor.run()

0 comments on commit d5a1f59

Please sign in to comment.