Skip to content

Commit fd2bec1

Browse files
authored
Fix Port issue (#126)
1 parent 5f8eea1 commit fd2bec1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

eval_protocol/pytest/evaluation_test.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -733,16 +733,18 @@ async def _collect_result(config, lst):
733733
r.eval_metadata.status = Status.eval_finished()
734734
active_logger.log(r)
735735

736-
tasks = []
737-
for i in range(num_runs):
738-
tasks.append(asyncio.create_task(execute_run(i, config)))
739-
740736
# if rollout_processor is McpGymRolloutProcessor, we execute runs sequentially since McpGym does not support concurrent runs
741737
# else, we execute runs in parallel
742738
if isinstance(rollout_processor, MCPGymRolloutProcessor):
743-
for task in tasks:
739+
# For MCPGymRolloutProcessor, create and execute tasks one at a time to avoid port conflicts
740+
for i in range(num_runs):
741+
task = asyncio.create_task(execute_run(i, config))
744742
await task
745743
else:
744+
# For other processors, create all tasks at once and run in parallel
745+
tasks = []
746+
for i in range(num_runs):
747+
tasks.append(asyncio.create_task(execute_run(i, config)))
746748
await asyncio.gather(*tasks)
747749

748750
# for groupwise mode, the result contains eval otuput from multiple completion_params, we need to differentiate them

0 commit comments

Comments
 (0)