test(tabs): drive the tab reorder tests with a gesture the strip can receive - #2546
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
EditorTabReorderUITestshas failed on every CI run since it landed in #2472, whose own run wascancelled, so it has never passed. All four cases fail on CI and one fails locally.
The strip itself is fine. The suite drove it in a way that cannot work.
What was wrong
The drag started outside the viewport.
testDraggingATabReordersAnOverflowingStripopens eighttables so the track scrolls, then dragged
before[0]. Once the track scrolls, the leading andtrailing tabs are half outside the viewport and stay in the accessibility tree at frames the pointer
cannot land on, so the press never reached the strip. That is what the local failure reported, in
its own words: "The dragged tab must be hittable".
Measured with temporary logging inside
updateReorder, over a full run of the suite:tabWidth186)tabWidth120)Zero callbacks is the whole story: the gesture never began, so nothing downstream could have
reordered anything.
The assertion raced the animation. Every case slept a flat second after the gesture and then
compared the order once. The strip animates the move and commits on release, so on a loaded machine
that read the pre-drag order and reported a working reorder as broken. That fits the CI signature
exactly: the three non-overflowing cases pass locally and fail on CI with the order unchanged.
What changed
waitForTabOrder(toChangeFrom:in:)) instead of sleeping. A sleeplong enough for CI is dead time on every local run; one short enough locally reads the wrong
order on CI.
original failure.
Also fixed
TextLayoutManager.layoutLinesbuilt its invalidation rect withlayoutView?.frame.width ?? 0, andCGRect.unionreturns the other operand when one is empty. An unparented or zero-width layout viewtherefore left the rect null and silently skipped the repaint, which is the defect that
invalidation exists to prevent. It now accumulates a vertical span and builds the rect once, from
the view it is about to invalidate. Found by an audit of #2542 rather than by a failure.
Verification
EditorTabReorderUITests: 8 executed, 8 passed, 0 failed.swift test --package-path LocalPackages/CodeEditTextView: 190 passed.this branch was cut.