Repository navigation
ci(unit): give the macOS and Windows smoke jobs time to finish - #4580
Conversation
After amd#4562, every open PR still failed both smoke jobs on tests from main. - Windows: the Lemonade-interpreter tests patched sys.platform globally. pyfakefs 6.2 reads it in teardown and calls os.getuid, which Windows lacks. They now patch only the uninstall module's sys. - macOS: torch, imported by an earlier test, puts a second OpenMP runtime in the process, and memory recall then refuses the faiss search that would abort it. test_memory_turn_recall now skips with that reason via require_faiss, as the other faiss tests do, instead of failing — or passing vacuously on the checks that expect nothing surfaced.
|
Verdict: Approve with suggestions This PR fixes the two unit tests that fail the Windows and macOS smoke jobs on every PR. Both fixes look right. The Windows tests now fake Linux only inside the uninstall module, so pyfakefs's teardown no longer sees the fake platform. The macOS recall tests now skip when an extra OpenMP runtime would make the faiss search refuse to run, the same way the other faiss tests already do. One gap: the last test in the memory-recall file builds its own test object rather than using the gated fixture, so it never reaches the new skip. It runs a search and checks that the note was recalled. Under the same torch-loaded conditions, that check will most likely still fail on macOS. Add the same skip call to that test before merging, or the macOS job may stay red. Real-world evidenceN/A — tests-only change, so there's no user-facing surface to exercise. The verdict rests on static review. The author reports a local Windows pass, and the CI smoke jobs will confirm. 🔍 Technical details🟡 One recall test skips the new gate (tests/unit/test_memory_turn_recall.py:390)
If the macOS log from the earlier run doesn't show this test failing, ignore this. It's still worth gating it for consistency. Strengths
|
…d#4580's fixes With the shebang tests fixed, the Windows smoke job stopped at the uninstall dry-run test, which looked for '.gaia/bin' in output that prints Windows paths with backslashes. The needles now use the platform separator, and the two tests that strip install.sh's shell rc blocks run only on POSIX, since Windows installs edit the user PATH instead. On macOS the one recall test that builds its own host skipped the faiss gate, so it still failed when torch's OpenMP runtime was loaded; it now calls require_faiss() like the fixture-backed tests.
With the early failures cleared, the smoke jobs now run the whole unit suite instead of stopping at the first error: macOS was cancelled by its 30-minute limit at 92%, and Windows needs about 40 minutes at its observed pace.
…ll through the fake Popen On Windows the manager's shutdown calls subprocess.run(taskkill), which went through the faked Popen and failed with a TypeError, stopping the Windows smoke job at 38%. The tests now fake run alongside Popen, so no taskkill reaches the fake pid either.
…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.
…op (amd#4585) 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. - **Uninstall shebang tests:** they fake Linux only inside the uninstall module, so pyfakefs teardown no longer calls `os.getuid` on Windows. Installer-leftover paths are built the way the platform prints them. - **Sidecar manager tests:** only real child processes reach the tree-kill (and so `taskkill` on Windows); `os.killpg`/`os.getpgid` fakes no longer error on Windows, where they don't exist. - **CLI refusal test:** the subprocess gets `USERPROFILE`/`SYSTEMROOT` (Windows finds its home and starts Python from them) and reads its output as UTF-8 (the refusal prints an emoji). - **Dev-anchor tests:** expected paths are built the way the platform prints them. - **Reap tests:** the two that assert a process-group kill skip on Windows, where the code deliberately skips that kill (a documented gap). Test-only change. Merge this before amd#4580, which now only raises the smoke-job timeouts. The macOS smoke failure was fixed by amd#4662. ## Test plan - [x] `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.py` on macOS after merging main: 298 passed, 4 skipped - [ ] `Unit Tests (Windows smoke)` gets past these files on this PR's run - [ ] With amd#4580 also merged, `Unit Tests (Windows smoke)` is green on main --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
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.getuidteardown and the sidecar taskkill in #4585, and the macOS recall failure in #4662 (merged; it removes the torch import at its root instead of skipping the test). Merge #4585 first; this PR no longer touches any test file, so the two don't conflict.Test plan
test_memory_turn_recall.py,test_agent_sidecar_manager.py,installer/test_uninstall_command.pyat main's versions: 148 passed, 4 skipped