1313import asyncio
1414import json
1515import math
16+ from multiprocessing import get_context
1617from pathlib import Path
1718
1819import pytest
@@ -171,7 +172,11 @@ def test_next_request_time_scaled_timestamps(self):
171172 relative_timestamps = [0.0 , 0.5 , 1.0 ],
172173 time_scale = 2.0 ,
173174 )
174- strategy .init_processes_timings (worker_count = 1 , max_concurrency = 10 )
175+ strategy .init_processes_timings (
176+ worker_count = 1 ,
177+ max_concurrency = 10 ,
178+ mp_context = get_context (),
179+ )
175180 strategy .init_processes_start (1000.0 )
176181 expected = [1000.0 , 1001.0 , 1002.0 ]
177182
@@ -194,7 +199,11 @@ def test_next_request_time_beyond_trace_parks_worker(self):
194199 relative_timestamps = [0.0 , 1.0 ],
195200 time_scale = 1.0 ,
196201 )
197- strategy .init_processes_timings (worker_count = 1 , max_concurrency = 10 )
202+ strategy .init_processes_timings (
203+ worker_count = 1 ,
204+ max_concurrency = 10 ,
205+ mp_context = get_context (),
206+ )
198207 strategy .init_processes_start (500.0 )
199208
200209 async def run ():
@@ -239,7 +248,11 @@ def test_scheduling_patterns(self, timestamps, expected):
239248 relative_timestamps = timestamps ,
240249 time_scale = 1.0 ,
241250 )
242- strategy .init_processes_timings (worker_count = 3 , max_concurrency = 10 )
251+ strategy .init_processes_timings (
252+ worker_count = 3 ,
253+ max_concurrency = 10 ,
254+ mp_context = get_context (),
255+ )
243256 strategy .init_processes_start (1000.0 )
244257
245258 async def run ():
0 commit comments