@@ -57,13 +57,25 @@ def lora_adapter_path(request: pytest.FixtureRequest) -> str:
57
57
return path
58
58
59
59
60
+ @pytest .fixture (
61
+ params = [
62
+ pytest .param (True , id = "disable-frontend-multiprocessing=True" ),
63
+ pytest .param (False , id = "disable-frontend-multiprocessing=False" ),
64
+ ]
65
+ )
66
+ def disable_frontend_multiprocessing (request ):
67
+ """Enable or disable the frontend-multiprocessing feature."""
68
+ return request .param
69
+
70
+
60
71
@pytest .fixture ()
61
- def args (
72
+ def args ( # noqa: PLR0913
62
73
request : pytest .FixtureRequest ,
63
74
monkeypatch ,
64
75
grpc_server_port : ArgFixture [int ],
65
76
http_server_port : ArgFixture [int ],
66
77
lora_available : ArgFixture [bool ],
78
+ disable_frontend_multiprocessing ,
67
79
) -> argparse .Namespace :
68
80
"""Return parsed CLI arguments for the adapter/vLLM."""
69
81
# avoid parsing pytest arguments as vllm/vllm_tgis_adapter arguments
@@ -75,6 +87,9 @@ def args(
75
87
76
88
extra_args .extend (("--enable-lora" , f"--lora-modules={ name } ={ path } " ))
77
89
90
+ if disable_frontend_multiprocessing :
91
+ extra_args .append ("--disable-frontend-multiprocessing" )
92
+
78
93
monkeypatch .setattr (
79
94
sys ,
80
95
"argv" ,
@@ -179,3 +194,13 @@ def target():
179
194
task .cancel ()
180
195
181
196
t .join ()
197
+
198
+ # rorkaround: Instantiating the TGISStatLogger multiple times creates
199
+ # multiple Gauges etc which can only be instantiated once.
200
+ # By unregistering the Collectors from the REGISTRY we can
201
+ # work around this problem.
202
+
203
+ from prometheus_client .registry import REGISTRY
204
+
205
+ for name in list (REGISTRY ._collector_to_names .keys ()): # noqa: SLF001
206
+ REGISTRY .unregister (name )
0 commit comments