Repository navigation
test: clear the Windows-only failures behind the smoke job's first stop - #4585
Conversation
The fake-spawn helper let shutdown reach the real tree-kill: on Windows its taskkill went through the patched Popen and crashed, and on POSIX it sent SIGTERM to process group 4242, whatever that is on the machine. Stub the tree-kill and the group probe in the helper.
A second test patches Popen itself rather than using the fake-spawn helper, so its shutdown still ran taskkill (Windows) or killpg (POSIX) against the fake pid. An autouse fixture now passes only real Popen children to the tree-kill.
Windows' os has neither, so monkeypatch.setattr raised before the test ran; raising=False creates the stand-in instead.
The stripped env set only HOME, but Windows resolves the home dir from USERPROFILE, so the child crashed at import before printing the refusal.
The refusal prints an emoji; on Windows the parent decoded the pipe as cp1252 and got None for stdout. Pin the child's and the reader's encoding to UTF-8.
reap_stale deliberately leaves a dead leader's survivors alone on Windows (a documented gap: no process group to kill), so asserting a group kill there can only fail.
…them The fake daemon replied with a POSIX string while the resolver returned a Path, which Windows renders with backslashes, so the CLI saw a mismatch that no real daemon would report.
|
Verdict: Approve with suggestions This PR changes tests only. It clears the next batch of failures that show up only on Windows, so the Windows smoke job can run to the end. It also fixes a real hazard on Linux and macOS: the sidecar tests' fake process id could reach the real kill-the-process-group call and signal whatever unrelated process group owned that id. The new safety net only lets real child processes reach that call, which is the right fix. Nothing blocks merge. I have two small cleanups, both optional. One recorded value is never checked. And now that the safety net exists, the old per-test stubs for the kill functions do nothing and could be deleted instead of loosened. Real-world evidenceN/A: this PR touches tests only, so there's no CLI, API, MCP or UI surface to exercise. The verdict rests on static review. I couldn't run the tests here (pytest isn't installed in this runner), and the PR's CI checks, including 🔍 Technical detailsIssues found 🟢 The recorded signals are never asserted ( 🟢 The 🟢 The leftover Strengths
|
The fake-spawn helper recorded each signal but nothing read them; a clean stop now asserts one SIGTERM and no SIGKILL. The group-alive stub is patched as the staticmethod it replaces, and a stale killpg comment says what the stub is for.
…ardown on Windows
…md#4662) Every open PR shows these two failures; this clears them. The macOS one is fixed here; the Windows one is fixed by amd#4585, so the smoke jobs go green once both merge. - **macOS, `test_memory_turn_recall`:** an audio test imported the Whisper ASR module, and that import loaded torch. Once torch is loaded, macOS has two OpenMP runtimes in the process (torch's and faiss's), so memory recall refuses every faiss search for the rest of the run. torch and whisper are now imported only when an ASR is actually created. The recall test runs and passes; it isn't skipped. amd#4580 handles this failure by skipping the test, so drop that half of amd#4580 when this merges. - **Windows, `test_resolves_direct_shebang_posix`:** the test faked Linux by patching `sys.platform` for the whole process. pyfakefs teardown then took the POSIX path and called `os.getuid`, which doesn't exist on Windows. amd#4585 now patches only the uninstall module's view of the platform, so this PR doesn't touch it. The macOS failure dates from amd#4061 (Sep 28), which added the recall test after the torch-loading audio test from amd#3616. The smoke job runs with `-x`, so earlier failures hid it until amd#4562 fixed those on Oct 2. ## Test plan - [x] New `test_importing_whisper_asr_does_not_load_torch` fails on main and passes here - [x] Locally on macOS, all audio and memory tests in CI order: 433 passed, `test_memory_turn_recall` included - [x] Locally on macOS, every unit test up to and including the recall test: torch never loads, and recall passes. The 13 failures are local env noise (CLI binaries not on PATH, pip frontends); none import the audio module - [ ] CI: "Unit Tests (macOS smoke)" passes `test_memory_turn_recall.py` Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
…md#4662 amd#4585 now patches only the uninstall module's platform, and its autouse fixture never tree-kills a fake sidecar pid, which is the only path that ran taskkill. amd#4662 fixed the torch import that broke faiss recall on macOS, so the recall test no longer needs a skip. This PR keeps only the smoke-job timeouts.
) The macOS and Windows unit-test smoke jobs hit their 30-minute limit before the suite finishes, so even with every test fixed they can't go green. This raises the limits to fit a full run: 45 min on macOS (a full run takes ~33) and 60 on Windows (15 min reached 6,873 of ~18,000 tests). The test fixes this PR first carried now live elsewhere: the Windows `os.getuid` teardown and the sidecar taskkill in amd#4585, and the macOS recall failure in amd#4662 (merged; it removes the torch import at its root instead of skipping the test). Merge amd#4585 first; this PR no longer touches any test file, so the two don't conflict. ## Test plan - [ ] CI: after amd#4585, "Unit Tests (macOS smoke)" and "Unit Tests (Windows smoke)" run to the end inside the new limits - [x] Locally (macOS): `test_memory_turn_recall.py`, `test_agent_sidecar_manager.py`, `installer/test_uninstall_command.py` at main's versions: 148 passed, 4 skipped --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
The Windows smoke job stops at the first failing test, so every fix so far has only revealed the next Windows-only failure. This clears all the ones known so far in one go so the job can finally reach the end. One is more than a Windows problem: the sidecar tests' fake process (pid 4242) reached the real tree-kill, so on Linux and macOS each run sent SIGTERM to whatever real process group held that id, and the error was swallowed.
os.getuidon Windows. Installer-leftover paths are built the way the platform prints them.taskkillon Windows);os.killpg/os.getpgidfakes no longer error on Windows, where they don't exist.USERPROFILE/SYSTEMROOT(Windows finds its home and starts Python from them) and reads its output as UTF-8 (the refusal prints an emoji).Test-only change. Merge this before #4580, which now only raises the smoke-job timeouts. The macOS smoke failure was fixed by #4662.
Test plan
pytest tests/unit/test_agent_sidecar_manager.py tests/unit/installer/test_uninstall_command.py tests/unit/test_cli_refusal_exit_codes.py tests/unit/test_daemon_cli_dev_anchor.py tests/unit/test_daemon_agents_routes.py tests/unit/test_project_map.pyon macOS after merging main: 298 passed, 4 skippedUnit Tests (Windows smoke)gets past these files on this PR's runUnit Tests (Windows smoke)is green on main