MCPcopy Create free account
hub / github.com/modelscope/modelscope / parallel_run_case

Function parallel_run_case

tests/run.py:270–287  ·  view source on GitHub ↗
(isolated_cases, result_dir, parallel)

Source from the content-addressed store, hash-verified

268
269
270def parallel_run_case(isolated_cases, result_dir, parallel):
271 # case worker processes
272 worker_processes = [None] * parallel
273 for test_suite_file in isolated_cases: # run case in subprocess
274 cmd = [
275 'python',
276 'tests/run.py',
277 '--pattern',
278 test_suite_file,
279 '--result_dir',
280 result_dir,
281 ]
282 worker_idx = wait_for_free_worker(worker_processes)
283 worker_process = async_run_command_with_popen(cmd, worker_idx)
284 os.set_blocking(worker_process.stdout.fileno(), False)
285 worker_processes[worker_idx] = worker_process
286
287 wait_for_workers(worker_processes)
288
289
290def parallel_run_case_in_env(env_name, env, test_suite_env_map, isolated_cases,

Callers 1

run_in_subprocessFunction · 0.85

Calls 3

wait_for_free_workerFunction · 0.85
wait_for_workersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…