Repository navigation
perf(ios-runner): settle post-snapshot interactions on a deadline, not a fixed sleep - #5130
Merged
thymikee merged 1 commit intoNov 26, 2026
Conversation
…t a fixed sleep Replace mainOwned.needsPostSnapshotInteractionDelay with a monotonic postSnapshotInteractionReadyUptime deadline stamped when an XCTest snapshot finishes, mirroring firstInteractionWindow (callstack#2395). applyInteractionStabilizationIfNeeded() now sleeps only the remaining part of the 200 ms post-snapshot window and clears the deadline.
Member
|
Thanks for the contribution, no code problems were found at 21c99f3, and the required evidence is in place. Not verified here: the simulator before/after timings and the runner XCTest result (21 passed, 0 failed) are author-reported and were not re-run, and no physical-device run was done; simulator evidence covers the XCTest behavior this change touches. The only failing checks are two cancelled |
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
Follow-up to #2395. After every XCTest snapshot, the runner set
mainOwned.needsPostSnapshotInteractionDelay = true, causingapplyInteractionStabilizationIfNeeded()to sleep a flat0.2 son the next interaction even when seconds had already passed.Replace the boolean with a monotonic
postSnapshotInteractionReadyUptime: TimeInterval?deadline stamped inbeginPostSnapshotInteractionStabilization()when the snapshot finishes, mirroringfirstInteractionWindow(#2395, #3532).applyInteractionStabilizationIfNeeded()sleeps onlyreadyUptime - ProcessInfo.processInfo.systemUptimeand clears the deadline. The guard (from #72) is a minimum gap after the snapshot, so elapsed time satisfies it: tight loops keep the full 200 ms; agent-paced flows credit elapsed round-trip time instead of paying 200 ms twice.Before / after (iPhone 17 Pro, iOS 27.2 simulator, Settings)
snapshot -i --actions(XCTest path) thenfill(350 ms gap, N=7; 0 ms gap, N=5) and back-to-backpress(0 ms gap, N=5):9d6059c120)21c99f3250)fillaccept→dispatch (350 ms)fillrunnertype(350 ms)fillCLI wall (350 ms)fillaccept→dispatch (0 ms)presslanded (0 ms)Validation
21c99f3250.LifecycleCacheTests+SnapshotExecutionTests, iOS 27.2 simulator): 21 tests, 0 failures.ios,macos,tvos,visionos,watchos) succeeded.pnpm check:affected --base upstream/main --run --head 21c99f3250(native-dupes,xctest-selection,packaged-runner-swift),pnpm check:quick, andpnpm format:checkpassed.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.