Repository navigation
fix: make keyboard pipeline tests hermetic and assert NFC at scalar level - #14
Merged
Merged
Conversation
…evel
KeyboardInputPipelineProcessTests drove KeyboardInputPipeline without
injecting spotlightVisibilityProvider, so the real Spotlight window
detector decided the context. On GitHub-hosted runners a Spotlight-owned
window is on-screen, which flipped the pipeline into Spotlight mode
(selection replacement, no Chromium empty-character break) and failed
five tests deterministically. Inject { false } in every context-sensitive
construction; Spotlight-behavior tests already inject their own provider.
VietnameseEngineEdgeCaseTests:640 compared NFD vs NFC with String ==,
which is canonical-equivalence — always equal, so the precondition could
never pass. Compare unicode scalars instead, and likewise harden the
per-unit-NFC invariant and the wire-text NFC asserts in
KeyboardInputPipelineProcessTests, which were vacuous for the same reason.
jonaskahn
force-pushed
the
fix/ci-test-hermeticity
branch
from
October 16, 2026 11:12
39a0eb1 to
5e73ad6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CI (run 38877143025) has been red since #12 — the same 6 unit tests fail deterministically on GitHub-hosted runners while passing on a dev Mac. Only
test (unit-2)andtest (unit-4)fail the run; theui-known-broken-on-hosted-runnershard is tolerated by design (continue-on-error).Root causes
1. Non-hermetic
KeyboardInputPipelineProcessTests(5 failures) — the tests never injectedspotlightVisibilityProvider, so the default probed the real machine (SpotlightWindowDetector.isSpotlightWindowVisible). On hosted runners aSpotlight-owned window is on-screen, socurrentCompatibilityRule()returned the Spotlight rule (.spotlightSelection): replacements went out as shift+left selection instead of backspaces, and the Chromium U+200B empty-character break after Space-commit was skipped. Exactly the two observed failure shapes. Fix: injectspotlightVisibilityProvider: { false }in every context-sensitive pipeline construction (Spotlight-behavior tests already inject their own).2. Unsatisfiable assertion in
VietnameseEngineEdgeCaseTests(1 failure) —XCTAssertNotEqual(text, text.precomposed…)compares SwiftStrings, whose==is canonical-equivalence: NFD and NFC are always equal, so the "sample must actually be decomposed" precondition could never pass. Fix: compareunicodeScalars(the sample was in fact decomposed). The per-unit-NFC invariant and two wire-text NFC asserts inKeyboardInputPipelineProcessTestswere vacuous for the same reason — hardened to scalar-level too.UI test failures (investigated, no code change)
The 14 Onboarding/Settings failures are click-then-verify cases quarantined in
ui-known-broken-on-hosted-runnersince97d1dba: hosted runners cannot make an AppKit window key (AX tree queryable,isHittabletrue, activation never lands), so clicks/sheets silently no-op. Deterministic, not flaky; not a regression (blocking shardsui-1…ui-5are green on the same runs). The fix is infrastructure — a self-hosted runner with a real GUI session — perci.yml:267-278anddocs/operations.md. No in-app change attempted.Verification
unit-2andunit-4green;ui-known-brokenmay still show its internal failures (expected, non-blocking).