Skip to content

fix(tts): make test_isolation_mode_in_process_vs_subprocess host-family-aware (#2696) - #2697

Open
rollroyces wants to merge 1 commit into
debpalash:mainfrom
rollroyces:fix/2696-test-isolation-mode-host-family
Open

rollroyces wants to merge 1 commit into
debpalash:mainfrom
rollroyces:fix/2696-test-isolation-mode-host-family

Conversation

@rollroyces

@rollroyces rollroyces commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

tests/backend/services/test_tts_backend_registry.py::test_isolation_mode_in_process_vs_subprocess fails on every Apple Silicon Mac. The assertion was added before _effective_backend_class() started routing the canonical omnivoice id to OmniVoiceMPSSubprocessBackend on MPS hosts — a documented, intentional behaviour. The test was forgotten and the stale comment "The pre-existing OmniVoice backend is in-process — sanity check." stayed in.

This PR makes the assertion host-family-aware: in-process on non-MPS hosts, subprocess on MPS hosts. The behaviour is unchanged; only the test adapts to it. detect_host_caps() is the same signal the production code uses, so there is no new dependency.

Fixes #2696.

Changes

  • tests/backend/services/test_tts_backend_registry.py (line ~276): replaced the unconditional assert out["omnivoice"]["isolation_mode"] == "in-process" with a host-family-aware assertion. The pre-existing fake-sub and healthy-inproc assertions are unchanged. The replacement comment documents WHY the assertion is now branched, with a pointer to the production docstring in tts_backend.py:list_backends().

Why the test was wrong, not the code

  • tts_backend.py:_effective_backend_class() was added later than the test and intentionally routes omnivoice to OmniVoiceMPSSubprocessBackend on Apple Silicon.
  • The intent is documented in list_backends(): "On MPS, the canonical omnivoice id already resolves to the killable OmniVoice sidecar."
  • The omnivoice-subprocess lazy-registry entry exists to keep the configurable OMNIVOICE_TTS_BACKEND=omnivoice-subprocess override working, not to expose a second runtime.
  • So the runtime IS subprocess on Apple Silicon, in-process everywhere else — and the test must read the same signal the runtime reads.

Type

  • Test fix (no behaviour change)

Testing

  • uv run --frozen pytest 'tests/backend/services/test_tts_backend_registry.py::test_isolation_mode_in_process_vs_subprocess' -q → 1 passed (this host is Apple Silicon)
  • uv run --frozen pytest tests/backend/services/test_tts_backend_registry.py -q → 15 passed (whole file, no regression)
  • Negative test: stashed the change, re-ran the test, it failed with the expected assert 'subprocess' == 'in-process'. Un-stashed, it passes again. The "fails without this change" criterion is satisfied.

Checklist

  • Forked the repo and branched from main
  • PR title uses Conventional Commit format with scope, referencing the issue (fix(tts): …)
  • All template sections filled
  • Tests added/changed fail without the source change and pass with it (negative test run above)
  • CHANGELOG Unreleased entry — deferred to maintainer per their active reorganisation of the section
  • AI-assisted contribution noted per CLA 1.0 §5.5 (the test was written by rollroyces with AI assistance; reviewed, accepted, and signed)

The test now expects omnivoice isolation mode to be "subprocess" on MPS hosts and "in-process" on other hosts. This matches the existing MPS routing and corrects the stale assertion without changing runtime behavior. No specific merge risk is evident from the supplied changes.

…ly-aware (debpalash#2696)

The assertion was added in commit 8e2928c (Sep 9 2026) with the comment
'The pre-existing OmniVoice backend is in-process — sanity check.' A
later change in tts_backend.py introduced _effective_backend_class,
which intentionally routes the canonical omnivoice id to the killable
OmniVoiceMPSSubprocessBackend on Apple Silicon hosts. The new
behaviour is documented in list_backends() and the comment for the
'omnivoice-subprocess' lazy-registry entry; the test was simply
forgotten.

On every Linux/Windows CI runner (host_family != mps) the assertion
still passes; on every Apple Silicon Mac it now reads
'isolated_mode = subprocess' and fails. Local contributors see a red
CI on a single test that is not a real regression, which masks any
genuine future failure of the same test.

Make the assertion host-family-aware: 'in-process' on non-MPS hosts,
'subprocess' on MPS hosts. The behaviour is unchanged; only the test
adapts to it. Detected by detect_host_caps() — the same signal the
underlying production code uses.

Fixes debpalash#2696.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: debpalash/VoiceStudio/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: da128509-833f-4e5f-907b-f97814697b87

📥 Commits

Reviewing files that changed from the base of the PR and between 06c6e07 and eb7d0e6.


📒 Files selected for processing (1)
  • tests/backend/services/test_tts_backend_registry.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The test now checks for subprocess isolation on MPS hosts and in-process isolation on other hosts. Backend behavior is unchanged.

Changes

OmniVoice isolation test

Layer / File(s) Summary
Host-aware isolation expectation
tests/backend/services/test_tts_backend_registry.py
The test expects subprocess isolation when the detected host family is mps, and in-process isolation otherwise.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: debpalash


Merge Risk: ⚪ Minimal · up to eb7d0

This change aligns the isolation-mode test with the host-dependent behavior described for the backend; no production behavior changes, so no material merge risk remains.

Pre-merge checks | Passed 9
✅ Passed checks (9 passed)
Check name Status Explanation
Title check Passed The title uses Conventional Commit format with the required scope and includes issue reference #2696. It accurately describes the host-family-aware test fix.
Description check Passed The description includes the required summary, changes, type, testing, checklist, and release cadence sections. It explains the issue, scope, validation results, and confirms that runtime behavior is …
Linked Issues check Passed Issue #2696 requires a host-family-aware assertion for the existing omnivoice routing. The changed test uses detect_host_caps().family and expects subprocess for mps and in-process otherwise…
Out of Scope Changes check Passed The pull request changes only test_isolation_mode_in_process_vs_subprocess and its explanatory comment. The import and conditional assertion directly support issue #2696, and no unrelated production…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
Cross-Platform Default Parity Passed The pull request changes only tests/backend/services/test_tts_backend_registry.py. It does not change runtime defaults or default-mode behavior. The unchanged production code already routes `omnivoi…
I18n Completeness (21 Locales) Passed The pull request changes only tests/backend/services/test_tts_backend_registry.py. The diff contains no Electron UI code, no t('...') keys, and no user-facing UI strings that bypass i18n. The 21-l…
Local-First Guarantee Passed PASS — The PR changes only tests/backend/services/test_tts_backend_registry.py. It adds a local detect_host_caps() read; its implementation documents and performs no network call. The diff adds no…
Backward Compatibility Passed The pull request changes only tests/backend/services/test_tts_backend_registry.py. It adds a test-only detect_host_caps() import and changes the expected assertion for omnivoice; it does not mod…

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Retrigger

[Low impact] The PR appears safe to merge.

Summary

The test now expects the host-specific OmniVoice isolation mode. No merge-blocking findings were found.

  • The OmniVoice isolation test now matches the host's runtime route.

Reviews (1) · Last reviewed commit: "fix(tts): make test_isolation_mode_in_pr..." · Reviewed by Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_isolation_mode_in_process_vs_subprocess fails on Apple Silicon (stale assertion)

1 participant