@@ -153,14 +153,14 @@ def rng() -> NpGenerator:
153153 return default_rng (0 )
154154
155155
156- # ---------------------------------------------------------------------------
157- # Metrics sets
158- # ---------------------------------------------------------------------------
156+ # --------------------------------------------------------------------------- #
157+ # Metric sets #
158+ # --------------------------------------------------------------------------- #
159159
160160
161161@pytest .fixture (scope = "session" )
162162def enabled_sample_metrics () -> set [SampledMetricName ]:
163- """Default sample-level KPIs tracked in most tests."""
163+ """Default time-series KPIs collected in most tests."""
164164 return {
165165 SampledMetricName .READY_QUEUE_LEN ,
166166 SampledMetricName .RAM_IN_USE ,
@@ -169,59 +169,75 @@ def enabled_sample_metrics() -> set[SampledMetricName]:
169169
170170@pytest .fixture (scope = "session" )
171171def enabled_event_metrics () -> set [EventMetricName ]:
172- """Default event-level KPIs tracked in most tests."""
173- return {EventMetricName .RQS_LATENCY }
172+ """Default per-event KPIs collected in most tests."""
173+ return {
174+ EventMetricName .RQS_LATENCY ,
175+ }
174176
175177
176- # ---------------------------------------------------------------------------
177- # Global simulation settings
178- # ---------------------------------------------------------------------------
178+ # --------------------------------------------------------------------------- #
179+ # Global simulation settings #
180+ # --------------------------------------------------------------------------- #
179181
180182
181183@pytest .fixture
182184def sim_settings (
183185 enabled_sample_metrics : set [SampledMetricName ],
184186 enabled_event_metrics : set [EventMetricName ],
185187) -> SimulationSettings :
186- """A minimal `SimulationSettings` instance for unit tests."""
188+ """
189+ Minimal :class:`SimulationSettings` instance.
190+
191+ The simulation horizon is fixed to the lowest allowed value so that unit
192+ tests run quickly.
193+ """
187194 return SimulationSettings (
188195 total_simulation_time = TimeDefaults .MIN_SIMULATION_TIME ,
189196 enabled_sample_metrics = enabled_sample_metrics ,
190197 enabled_event_metrics = enabled_event_metrics ,
191198 )
192199
193200
194- # ---------------------------------------------------------------------------
195- # Traffic profile
196- # ---------------------------------------------------------------------------
201+ # --------------------------------------------------------------------------- #
202+ # Traffic profile #
203+ # --------------------------------------------------------------------------- #
197204
198205
199206@pytest .fixture
200207def rqs_input () -> RqsGeneratorInput :
201- """`RqsGeneratorInput` with 1 user and 2 req/min for quick tests."""
208+ """
209+ One active user issuing two requests per minute—sufficient to
210+ exercise the entire request-generator pipeline with minimal overhead.
211+ """
202212 return RqsGeneratorInput (
213+ id = "rqs-1" ,
203214 avg_active_users = RVConfig (mean = 1.0 ),
204215 avg_request_per_minute_per_user = RVConfig (mean = 2.0 ),
205216 user_sampling_window = TimeDefaults .USER_SAMPLING_WINDOW ,
206217 )
207218
208219
209- # ---------------------------------------------------------------------------
210- # Minimal topology (one client, no servers, no edges)
211- # ---------------------------------------------------------------------------
220+ # --------------------------------------------------------------------------- #
221+ # Minimal topology (one client, no servers, no edges) #
222+ # --------------------------------------------------------------------------- #
212223
213224
214225@pytest .fixture
215226def topology_minimal () -> TopologyGraph :
216- """Valid topology with a single client and zero servers/edges."""
227+ """
228+ A valid topology containing a single client and **no** servers or edges.
229+
230+ Suitable for low-level tests that do not need to traverse the server
231+ layer or network graph.
232+ """
217233 client = Client (id = "client-1" )
218234 nodes = TopologyNodes (servers = [], client = client )
219235 return TopologyGraph (nodes = nodes , edges = [])
220236
221237
222- # ---------------------------------------------------------------------------
223- # Full simulation payload
224- # ---------------------------------------------------------------------------
238+ # --------------------------------------------------------------------------- #
239+ # Complete simulation payload #
240+ # --------------------------------------------------------------------------- #
225241
226242
227243@pytest .fixture
@@ -230,7 +246,12 @@ def payload_base(
230246 sim_settings : SimulationSettings ,
231247 topology_minimal : TopologyGraph ,
232248) -> SimulationPayload :
233- """End-to-end payload used by high-level simulation tests."""
249+ """
250+ End-to-end payload used by integration tests and FastAPI endpoint tests.
251+
252+ It wires together the individual fixtures into the single object expected
253+ by the simulation engine.
254+ """
234255 return SimulationPayload (
235256 rqs_input = rqs_input ,
236257 topology_graph = topology_minimal ,
0 commit comments