Skip to content

Commit

Permalink
fix: csharp executor proxy test
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotzh committed Apr 25, 2024
1 parent 600d0bf commit 9b4076a
Showing 1 changed file with 10 additions and 2 deletions.
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

0 comments on commit 9b4076a

Please sign in to comment.