Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: csharp executor proxy ci failure #3018

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ class TestCSharpSdk:
"language": {"default": "chinese", "type": "string"},
"topic": {"default": "ocean", "type": "string"},
},
"outputs": {"output": {"type": "object"}},
"outputs": {
"Answer": {"type": "string"},
"AnswerLength": {"type": "int"},
"PoemLanguage": {"type": "string"},
},
},
id="function_mode_basic",
),
pytest.param(
{
"init": {"connection": {"type": "AzureOpenAIConnection"}, "name": {"type": "string"}},
"inputs": {"question": {"default": "What is Promptflow?", "type": "string"}},
"outputs": {"output": {"type": "object"}},
"outputs": {"output": {"type": "string"}},
},
id="class_init_flex_flow",
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import json
import platform
import signal
import socket
import subprocess
from pathlib import Path
Expand Down Expand Up @@ -62,7 +64,10 @@ async def test_destroy_with_terminates_gracefully(self):
await executor_proxy.destroy()

mock_process.poll.assert_called_once()
mock_process.terminate.assert_called_once()
if platform.system() != "Windows":
mock_process.terminate.assert_called_once()
else:
mock_process.send_signal.assert_called_once_with(signal.CTRL_BREAK_EVENT)
mock_process.wait.assert_called_once_with(timeout=5)
mock_process.kill.assert_not_called()

Expand All @@ -77,7 +82,10 @@ async def test_destroy_with_force_kill(self):
await executor_proxy.destroy()

mock_process.poll.assert_called_once()
mock_process.terminate.assert_called_once()
if platform.system() != "Windows":
mock_process.terminate.assert_called_once()
else:
mock_process.send_signal.assert_called_once_with(signal.CTRL_BREAK_EVENT)
mock_process.wait.assert_called_once_with(timeout=5)
mock_process.kill.assert_called_once()

Expand Down
Loading