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(
386
386
timeout : Optional [int ] = None ,
387
387
) -> Dict [str , Any ]:
388
388
start_time = time .time ()
389
+ process = None # Initialize process variable
389
390
390
391
try :
391
392
# Validate directory if specified
@@ -590,6 +591,11 @@ async def communicate_with_timeout():
590
591
"stderr" : str (e ),
591
592
"execution_time" : time .time () - start_time ,
592
593
}
594
+ finally :
595
+ # Ensure process is terminated
596
+ if process and process .returncode is None :
597
+ process .kill ()
598
+ await process .wait ()
593
599
594
600
async def _execute_pipeline (
595
601
self ,
@@ -692,5 +698,10 @@ async def _execute_pipeline(
692
698
}
693
699
694
700
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 ()
695
706
if isinstance (last_stdout , IO ):
696
707
last_stdout .close ()
Original file line number Diff line number Diff line change 1
1
import os
2
2
3
-
4
3
# Configure pytest-asyncio
5
4
def pytest_configure (config ):
6
5
"""Configure pytest-asyncio defaults"""
7
- config .option .asyncio_mode = "strict"
8
6
# Enable command execution for tests
9
7
os .environ ["ALLOW_COMMANDS" ] = "1"
10
8
# Add allowed commands for tests
You can’t perform that action at this time.
0 commit comments