test(macos): isolate workspace notification observers - #1168
Conversation
Greptile SummaryThis PR isolates macOS tray lifecycle tests from the process-global workspace notification center without changing production observer registration.
Confidence Score: 5/5The PR appears safe to merge because production observer behavior is preserved and the tests retain direct coverage of lifecycle selector delivery through isolated notification centers. The helper receives the same workspace notification center and workspace object in production, while each test consistently registers and posts through its own private center with the matching object filter.
|
| Filename | Overview |
|---|---|
| crates/openlogi-agent/src/tray.rs | Refactors observer installation for dependency injection and isolates notification delivery between parallel tests while preserving production filters and selectors. |
Reviews (1): Last reviewed commit: "test(macos): isolate workspace notificat..." | Re-trigger Greptile
|
The two macOS test failures I've been hitting aren't area-specific — worth landing this for everyone. Same assertion on three unrelated branches within the last hour: #1250 ( #1236 proposes a Verification favours this one too — 100 consecutive runs here after reproducing the failure, versus #1236 not being runnable on its author's machine at all. For an intermittent race a single green CI run isn't much signal either way. |
Summary
Stop the macOS tray lifecycle tests from affecting each other through the process-global
NSWorkspacenotification center. Under the default parallel Rust test harness, one test could deliver session notifications to the other test's observer and leave its device-I/O gate suspended.Changes
NSWorkspace's notification center.NSNotificationCenter, preserving selector-level coverage without cross-test delivery.Testing
cargo fmt --all -- --checkRUSTFLAGS="-D warnings" cargo clippy -p openlogi-agent --all-targets -- -D warningsRUSTFLAGS="-D warnings" cargo test -p openlogi-agentRUSTFLAGS="-D warnings" cargo test --workspace --all-targetsRefs #1142
Unblocks #1167