Repository navigation
mac: CompletionTests no longer traps on an empty suggestions array (#773) - #782
Merged
Merged
Conversation
) `testEnvironmentSnippetKeepsIndentationAndClosingStaysExact` indexed `s[0]`/`c[0]` right after asserting on the array's contents; a failed XCTAssertEqual doesn't stop execution, so if either array were ever empty the next line's array subscript traps and kills the whole xctest process instead of failing one assertion — exactly the mechanism that hid half the Mac suite for a day (see #681, #772). Switched both to the `.first?` idiom the same function already uses for its third suggestions array (`e`, two lines below), so an unexpected empty result fails the specific assertion instead of crashing the process. Verified: `swift build --build-tests` clean; `swift test --filter CompletionTests` — 38/38 pass, 0 failures, no trap. Commit-Executor: daniel-muse-lead (Claude Sonnet)
d-q222
added a commit
that referenced
this pull request
Sep 17, 2026
#784 All eight independently reviewed APPROVE. Batch verification: compiler 935/0, render-pipeline 487/0, perf-bench 14/0, perf gate OK (270 metrics, no regression), swift build --build-tests OK, CompletionTests 29/0. Commit-Executor: daniel-parent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
ItsAkilesh
pushed a commit
to ItsAkilesh/flashtex
that referenced
this pull request
Sep 18, 2026
…t run (flash-tex#773) A non-halting XCTAssert followed by unguarded indexing or force-unwrap trapped the process on a product regression, hiding every later result. CompletionTests now guard their indexing; the Nearby* waitUntil and lines(atLeast:) helpers now throw instead of only recording XCTFail, which caused the NearbyBoundedTransportTests index crash under load. CompletionTests.swift:314 is left to flash-tex#782. Implementation-Agent: claude-sonnet-5 subagent of daniel-parent Commit-Executor: daniel-parent Co-authored-by: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
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.
Summary
testEnvironmentSnippetKeepsIndentationAndClosingStaysExactindexeds[0]/c[0]right after asserting on the array's contents. A failedXCTAssertEqualdoesn't stop execution, so an unexpectedly-empty array would trap on the next line's subscript and kill the wholexctestprocess — the same failure mode that hid half the Mac suite for a day (P0: xctest aborts (signal 6) deterministically at IMECompositionTests.testCancelledCompositionLeavesTheHelperAndLedgerUntouched — regressed today on main, blocks the whole fleet's gate #681, mac: unblock the gate — bound both helper pipe drains, split IMECompositionTests out (#681) #772)..first?idiom the same function already uses for its third suggestions array (e), so an empty result fails the specific assertion instead of crashing the process.Fixes #773.
Test plan
swift build --build-tests(apps/mac) — cleanswift test --filter CompletionTests— 38/38 pass, 0 failures, no trapCommit-Executor: daniel-muse-lead (Claude Sonnet)
🤖 Generated with Claude Code