test: migrate 9 coordinator suites to KeyPathTestCase (#698)#706
Conversation
Move suites that construct RuntimeCoordinator/InstallerEngine/etc. onto the KeyPathTestCase base class so the testPIDProvider seam is installed and they no longer spawn real pgrep (the parallel-execution deadlock from #698). Removed each from the TestSeamLintTests allowlist. Migrated (each verified in isolation — passes, no deadlock): ContentViewDebounceTests, GrabRecoveryGateTests, InstallerEngineBrokerForwardingTests, KanataViewModelTests, KeyboardCaptureTests, LayerSelectorTests, OverlayHealthIndicatorObserverTests, RecordingCoordinatorTests, WizardRecipeParityTests (batch of 8 → 47 tests / 0 failures / 4.3s; KeyboardCaptureTests → 22 / 0 / 1.6s) Still allowlisted (intentionally not migrated): - ErrorHandlingTests, KeyPathTests, KanataManagerResetTests (RuntimeCoordinatorResetTests.swift): the seam fixes their pgrep hang but they also do real saveConfiguration/ updateStatus I/O that still hangs — needs deeper per-suite mocking. - VHIDDeviceManagerTests: the seam's OWN test suite (sets testPIDProvider per test and asserts the real-pgrep fallthrough); must not be force-seamed. - FacadeLintTests, PrivilegedOperationsCoordinatorTests, SystemRequirementsTests, WizardPureLogicTests: only reference the types, low priority. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code Review: PR #706 — Migrate 9 coordinator suites to KeyPathTestCaseOverall: LGTM with one minor doc nit. This is a clean, well-scoped mechanical refactor. The changes do exactly what they say, the ratchet enforces the invariant going forward, and the PR description provides solid evidence of no regressions. What this PR doesMigrates 9 test suites from Code quality ✅
One doc nit 📝The PR description refers to
But the file is actually No concerns on
Verdict: Fix the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41c3bde3ea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// Tests the save operation debouncing added in Phase 1.3 to prevent rapid successive saves | ||
| @MainActor | ||
| class ContentViewDebounceTests: XCTestCase { | ||
| class ContentViewDebounceTests: KeyPathTestCase { |
There was a problem hiding this comment.
Migrate the remaining logging suite too
This file still contains Phase1LoggingTests: XCTestCase at line 127, and that suite constructs RuntimeCoordinator() in testLoggingCapturesActualOperations. Because TestSeamLintTests skips an entire file once it sees : KeyPathTestCase, changing only ContentViewDebounceTests here removes the file from the allowlist while leaving the logging suite without the VHIDDeviceManager.testPIDProvider seam, so this test can still take the real pgrep path that this migration is meant to avoid.
Useful? React with 👍 / 👎.
| import XCTest | ||
|
|
||
| final class OverlayHealthIndicatorObserverTests: XCTestCase { | ||
| final class OverlayHealthIndicatorObserverTests: KeyPathTestCase { |
There was a problem hiding this comment.
Migrate the second observer suite
This file also defines HealthObserverInitializationOrderTests: XCTestCase at line 218, and that suite creates SystemValidator(vhidDeviceManager: VHIDDeviceManager(), ...). Since the lint guard checks for : KeyPathTestCase at file scope, this partial migration makes the file pass the ratchet even though that remaining suite still does not install the pgrep-avoidance seam, leaving the deadlock-prone path possible under parallel test runs.
Useful? React with 👍 / 👎.
Part of #698 — shrinks the test-seam allowlist from 17 → 8 by migrating suites that construct coordinators onto
KeyPathTestCase(installs thetestPIDProviderseam, preventing the real-pgrepdeadlock).Migrated (9) — each verified in isolation locally
ContentViewDebounceTests,GrabRecoveryGateTests,InstallerEngineBrokerForwardingTests,KanataViewModelTests,KeyboardCaptureTests,LayerSelectorTests,OverlayHealthIndicatorObserverTests,RecordingCoordinatorTests,WizardRecipeParityTests.KeyboardCaptureTests: 22 / 0 / 1.6s — no deadlock, no behavior change.Deliberately still allowlisted
ErrorHandlingTests,KeyPathTests,KanataManagerResetTests): the seam fixes their pgrep hang (verified:ErrorHandlingTests.testAsyncConfigurationErrorswent from hangs forever → 8ms) but they also do realsaveConfiguration/updateStatusI/O that still hangs. Need deeper per-suite mocking — tracked in Test suite deadlocks on real pgrep/process spawns; 249 suites bypass KeyPathTestCase safety base #698.VHIDDeviceManagerTests: the seam's own test suite (setstestPIDProviderper test, asserts the real-pgrep fallthrough). Must not be force-seamed.FacadeLintTests,PrivilegedOperationsCoordinatorTests,SystemRequirementsTests,WizardPureLogicTests: only reference the type names.The
TestSeamLintTestsratchet passes with the reduced allowlist (verified in isolation). CIbuild-and-testexercises the full suite as the backstop.