From 8646b6b1df59b6e3daf0daf9f3890245859ff667 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Sat, 6 Jun 2026 02:58:59 -0400 Subject: [PATCH 1/3] test(windows): hide test helper console windows (#3706) --- tests/browser_smoke.py | 1 + tests/conftest.py | 1 + tests/test_ctl_script.py | 10 ++++++++-- tests/test_tls_support.py | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/browser_smoke.py b/tests/browser_smoke.py index 7d84ae04631..a9178179b22 100644 --- a/tests/browser_smoke.py +++ b/tests/browser_smoke.py @@ -114,6 +114,7 @@ def main(): proc = subprocess.Popen( [sys.executable, server_py], cwd=repo_root, env=env, stdout=log, stderr=subprocess.STDOUT, + **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), ) try: if not _wait_for_health(timeout=30): diff --git a/tests/conftest.py b/tests/conftest.py index 5a9d7bb71f5..eb1e5e3b0b5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -636,6 +636,7 @@ def test_server(): env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, + **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), ) if not _wait_for_server(TEST_BASE, timeout=20): diff --git a/tests/test_ctl_script.py b/tests/test_ctl_script.py index fc4dfff5c6c..8500628bf7c 100644 --- a/tests/test_ctl_script.py +++ b/tests/test_ctl_script.py @@ -143,7 +143,10 @@ def windows_pid(pid: int) -> int | None: def start_fake_launchd_process() -> subprocess.Popen: - return subprocess.Popen(["bash", "-lc", "exec sleep 30"]) + return subprocess.Popen( + ["bash", "-lc", "exec sleep 30"], + **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), + ) def _kill_tree(pid: int) -> None: @@ -316,7 +319,10 @@ def test_stale_pid_file_is_removed_without_killing_unrelated_process(tmp_path): hermes_home = tmp_path / ".hermes" hermes_home.mkdir() pid_file = hermes_home / "webui.pid" - sleeper = subprocess.Popen([sys.executable, "-c", "import time; time.sleep(30)"]) + sleeper = subprocess.Popen( + [sys.executable, "-c", "import time; time.sleep(30)"], + **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), + ) try: pid_file.write_text(str(sleeper.pid), encoding="utf-8") result = run_ctl(tmp_path, "stop") diff --git a/tests/test_tls_support.py b/tests/test_tls_support.py index a43e89962d0..15f526724d8 100644 --- a/tests/test_tls_support.py +++ b/tests/test_tls_support.py @@ -6,6 +6,7 @@ import http.client import json import os +import sys import ssl import subprocess import textwrap @@ -79,6 +80,7 @@ def _start_server(port: int, cert: str = None, key: str = None) -> subprocess.Po [os.sys.executable, str(ROOT / "server.py")], env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, + **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), ) return proc From 0c714a0d31dafbb1ca69c5e8b2bb4b18baed777f Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Sat, 6 Jun 2026 03:11:13 -0400 Subject: [PATCH 2/3] test(windows): use CREATE_NO_WINDOW constant (#3706) --- tests/browser_smoke.py | 2 +- tests/conftest.py | 2 +- tests/test_ctl_script.py | 4 ++-- tests/test_tls_support.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/browser_smoke.py b/tests/browser_smoke.py index a9178179b22..e606731a91c 100644 --- a/tests/browser_smoke.py +++ b/tests/browser_smoke.py @@ -114,7 +114,7 @@ def main(): proc = subprocess.Popen( [sys.executable, server_py], cwd=repo_root, env=env, stdout=log, stderr=subprocess.STDOUT, - **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), + **({"creationflags": subprocess.CREATE_NO_WINDOW} if sys.platform == "win32" else {}), ) try: if not _wait_for_health(timeout=30): diff --git a/tests/conftest.py b/tests/conftest.py index eb1e5e3b0b5..dea1a6aefa8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -636,7 +636,7 @@ def test_server(): env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, - **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), + **({"creationflags": subprocess.CREATE_NO_WINDOW} if sys.platform == "win32" else {}), ) if not _wait_for_server(TEST_BASE, timeout=20): diff --git a/tests/test_ctl_script.py b/tests/test_ctl_script.py index 8500628bf7c..7827bdf368a 100644 --- a/tests/test_ctl_script.py +++ b/tests/test_ctl_script.py @@ -145,7 +145,7 @@ def windows_pid(pid: int) -> int | None: def start_fake_launchd_process() -> subprocess.Popen: return subprocess.Popen( ["bash", "-lc", "exec sleep 30"], - **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), + **({"creationflags": subprocess.CREATE_NO_WINDOW} if sys.platform == "win32" else {}), ) @@ -321,7 +321,7 @@ def test_stale_pid_file_is_removed_without_killing_unrelated_process(tmp_path): pid_file = hermes_home / "webui.pid" sleeper = subprocess.Popen( [sys.executable, "-c", "import time; time.sleep(30)"], - **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), + **({"creationflags": subprocess.CREATE_NO_WINDOW} if sys.platform == "win32" else {}), ) try: pid_file.write_text(str(sleeper.pid), encoding="utf-8") diff --git a/tests/test_tls_support.py b/tests/test_tls_support.py index 15f526724d8..06385744619 100644 --- a/tests/test_tls_support.py +++ b/tests/test_tls_support.py @@ -6,12 +6,12 @@ import http.client import json import os -import sys import ssl import subprocess +import sys +import tempfile import textwrap import time -import tempfile import unittest from contextlib import suppress from pathlib import Path @@ -80,7 +80,7 @@ def _start_server(port: int, cert: str = None, key: str = None) -> subprocess.Po [os.sys.executable, str(ROOT / "server.py")], env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, - **({"creationflags": 0x08000000} if sys.platform == "win32" else {}), + **({"creationflags": subprocess.CREATE_NO_WINDOW} if sys.platform == "win32" else {}), ) return proc From 2946dd11801bf014b8b993116b10bbc16290d008 Mon Sep 17 00:00:00 2001 From: nesquena-hermes <[email protected]> Date: Sat, 6 Jun 2026 23:08:04 +0000 Subject: [PATCH 3/3] test(windows): hide test-helper console windows on Windows (#3710 fixes #3706) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @rodboev. Long-lived test helper subprocesses (test server, browser-smoke, TLS helper, ctl helpers) now spawn with CREATE_NO_WINDOW on Windows so a local pytest run doesn't pop focus-stealing console windows. sys.platform=='win32' guarded → no-op on macOS/Linux (expands to **{}). Test-only, no production code, no user impact. + CHANGELOG v0.51.301. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ea077dd76..2d28c47358e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ ## [Unreleased] +## [v0.51.301] — 2026-06-06 — Release JQ (stage-3710 — hide test-helper console windows on Windows) + +### Changed +- **Developer experience (Windows):** the test suite's long-lived helper subprocesses (main test server, browser-smoke server, TLS helper, and the `ctl` test helpers) now spawn with `CREATE_NO_WINDOW` on Windows, so a local `pytest` run no longer pops up several focus-stealing console windows. Windows-only (`sys.platform == "win32"` guard); no behavior change on macOS/Linux. (#3710 fixes #3706, @rodboev) + ## [v0.51.300] — 2026-06-06 — Release JP (stage-3726 — context-length indicator honors provider per-model overrides) ### Fixed