Skip to content
Open
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
6 changes: 1 addition & 5 deletions artemis/runtime/daemon_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,7 @@ def spawn_daemon(
}

if sys.platform == "win32":
kwargs["creationflags"] = (
subprocess.CREATE_NEW_PROCESS_GROUP
| getattr(subprocess, "DETACHED_PROCESS", 0x00000008)
| getattr(subprocess, "CREATE_NO_WINDOW", 0x08000000)
)
kwargs["creationflags"] = subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.CREATE_NO_WINDOW
else:
kwargs["start_new_session"] = True

Expand Down
5 changes: 5 additions & 0 deletions tests/unit/runtime/test_daemon_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def test_is_daemon_running_failure():


def test_spawn_daemon(tmp_path):
import subprocess
import sys

mock_proc = MagicMock()
Expand All @@ -74,6 +75,10 @@ def test_spawn_daemon(tmp_path):
assert cmd[0] == sys.executable
assert cmd[1:3] == ["-m", "apps.admin_console.server"]
assert cmd[3:] == ["--host", "127.0.0.1", "--port", "9123"]
if sys.platform == "win32":
assert mock_popen.call_args.kwargs["creationflags"] == (
subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.CREATE_NO_WINDOW
)


def test_ensure_daemon_running_when_already_active():
Expand Down
Loading