diff --git a/ni_measurementlink_service/_internal/discovery_client.py b/ni_measurementlink_service/_internal/discovery_client.py index 5e00d11f4..84961c2dc 100644 --- a/ni_measurementlink_service/_internal/discovery_client.py +++ b/ni_measurementlink_service/_internal/discovery_client.py @@ -268,7 +268,7 @@ def _start_service( kwargs: Dict[str, Any] = {} if sys.platform == "win32": # Terminating the measurement service should not terminate the discovery service. - kwargs["creationflags"] = subprocess.CREATE_BREAKAWAY_FROM_JOB + kwargs["creationflags"] = subprocess.CREATE_BREAKAWAY_FROM_JOB | subprocess.DETACHED_PROCESS discovery_service_subprocess = subprocess.Popen( [exe_file_path], cwd=exe_file_path.parent, diff --git a/tests/unit/test_discovery_client.py b/tests/unit/test_discovery_client.py index f4ec58acd..e24839ef1 100644 --- a/tests/unit/test_discovery_client.py +++ b/tests/unit/test_discovery_client.py @@ -193,7 +193,7 @@ def test___discovery_service_exe_unavailable___register_service___raises_file_no def subprocess_popen_kwargs() -> Dict[str, Any]: kwargs: Dict[str, Any] = {} if sys.platform == "win32": - kwargs["creationflags"] = subprocess.CREATE_BREAKAWAY_FROM_JOB + kwargs["creationflags"] = subprocess.CREATE_BREAKAWAY_FROM_JOB | subprocess.DETACHED_PROCESS return kwargs