Repository navigation
Stop the UI readiness helpers busy-waiting and cascading failures - #45
Merged
Merged
Conversation
…ures Both found reviewing the commit before this one. `waitUntilHittable` used `waitForExistence(timeout: 0.1)` as its throttle. That returns immediately when the element already exists, which is precisely the case it is written for — present but not yet touchable, a sheet still animating in — so the loop spun on back-to-back accessibility snapshots for the whole twenty seconds instead of polling. Querying the app as hard as possible is a poor way to wait for it to settle, and one of the failures this helper exists to prevent was the app failing to report itself idle. It sleeps now. `tapWhenReady` recorded a failure and returned. `continueAfterFailure` is true by default, so the caller carried on: `typeWhenReady` would type into nothing and raise a second, unrelated "no keyboard focus" error over the top of the real one, and every later helper in the test would spend its own twenty seconds before doing the same — three times over, now that CI retries. Both helpers throw instead, so a test stops at the first unmet precondition and the report is about the thing that actually went wrong. `TailscaleImportUITests.bringIntoView` had the same non-throttle, from before this branch. Fixed with it rather than left as the one place that still does it. Verified: the UI suite on an iPhone, 8 passing, with the iPad leg running. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Two defects in the helper #41 added, found reviewing it. #41 merged before this was pushed to the branch, so it comes as its own change.
waitUntilHittablewas busy-waiting, not pollingwaitForExistencereturns immediately when the element already exists — which is precisely the case this helper is written for: present but not yet touchable, a sheet still animating in. So the loop spun on back-to-back accessibility snapshot queries for the full twenty seconds instead of polling at 100ms.Querying the app as hard as possible is a poor way to wait for it to settle, and one of the three failures this helper exists to prevent was
Timed out while synthesizing event— the app failing to report itself idle. It sleeps now.tapWhenReadyrecorded a failure and returnedcontinueAfterFailureis true by default, so the caller carried on.typeWhenReadywould then type into nothing and raise a second, unrelated "no keyboard focus" error on top of the real one, and every later helper in the test would spend its own twenty seconds before doing the same — three times over, now that CI retries with-test-iterations 3.Both helpers
thrownow, so a test stops at the first unmet precondition and the report is about what actually went wrong. Every call site takestry.Same defect, one place older
TailscaleImportUITests.bringIntoViewusedwaitForExistence(timeout: 0.2)as its throttle too, from before #41. Fixed alongside rather than left as the one place still doing it.Verified
The whole UI suite on both idioms locally — iPhone 8 passing, iPad passing, simulators shut down after.
🤖 Generated with Claude Code