File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,7 @@ async def execute(
386386 timeout : Optional [int ] = None ,
387387 ) -> Dict [str , Any ]:
388388 start_time = time .time ()
389+ process = None # Initialize process variable
389390
390391 try :
391392 # Validate directory if specified
@@ -590,6 +591,11 @@ async def communicate_with_timeout():
590591 "stderr" : str (e ),
591592 "execution_time" : time .time () - start_time ,
592593 }
594+ finally :
595+ # Ensure process is terminated
596+ if process and process .returncode is None :
597+ process .kill ()
598+ await process .wait ()
593599
594600 async def _execute_pipeline (
595601 self ,
@@ -692,5 +698,10 @@ async def _execute_pipeline(
692698 }
693699
694700 finally :
701+ # Ensure all processes are terminated
702+ for process in processes :
703+ if process .returncode is None :
704+ process .kill ()
705+ await process .wait ()
695706 if isinstance (last_stdout , IO ):
696707 last_stdout .close ()
Original file line number Diff line number Diff line change 11import os
22
3-
43# Configure pytest-asyncio
54def pytest_configure (config ):
65 """Configure pytest-asyncio defaults"""
7- config .option .asyncio_mode = "strict"
86 # Enable command execution for tests
97 os .environ ["ALLOW_COMMANDS" ] = "1"
108 # Add allowed commands for tests
You can’t perform that action at this time.
0 commit comments