Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,10 @@ def __exit__(self, exc_type, exc_value, traceback):
except (ProcessLookupError, OSError):
pgid = None

# Phase 1: graceful SIGTERM to the entire process group
if pgid is not None:
with contextlib.suppress(ProcessLookupError, OSError):
os.killpg(pgid, signal.SIGTERM)
print(f"[RemoteOpenAIServer] Sent SIGTERM to process group {pgid}")
else:
# Phase 1: graceful SIGTERM to the root process
with contextlib.suppress(ProcessLookupError, OSError):
self.proc.terminate()
print(f"[RemoteOpenAIServer] Sent SIGTERM to process {pid}")

try:
self.proc.wait(timeout=15)
Expand Down
Loading