refactor(ios): drop the transport seam usbmux-first made dead - #1540
Open
thymikee wants to merge 1 commit into
Open
refactor(ios): drop the transport seam usbmux-first made dead#1540thymikee wants to merge 1 commit into
thymikee wants to merge 1 commit into
Conversation
The physical-device control exposed resolveRunnerTransport returning either a network tunnel or usbmux, from before the route resolver decided transports. Since #1517 the resolver returns a usbmux route for XCTest devices and for any attached CoreDevice one, and only reaches the control after usbmux has reported the device unattached — so the control is asked exclusively for a tunnel. That left the usbmux arm with no live producer or consumer: the branch handling it in the resolver was unreachable, and the XCTest implementation returning it was called only by a test. Collapse the union to the one shape that is resolved, rename the seam to say what it does, delete the unreachable branch, and let XCTest reject a tunnel lookup the way it already rejects app inventory and process lookup — it has no CoreDevice tunnel, which is why the resolver never asks it for one.
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
Member
Author
|
Re-reviewed at |
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.
Answering "is there code we can safely drop now that usbmux is primary?" — yes, this much.
What went dead
IosPhysicalDeviceControlexposed:That predates #1517, when the control still chose the transport. Since #1517 the route resolver chooses: it returns a usbmux route for an XCTest device, and for a CoreDevice device too, reaching the control only after usbmux has reported the device unattached. At that point the sole question left is "what is the tunnel address".
So the
usbmuxarm has no live producer or consumer:if (transport.kind === 'usbmux')branch was unreachable — the only control that gets that far is CoreDevice, which always answersnetwork{ kind: 'usbmux' }was called only from a test; production returns a usbmux route before itChange
IosPhysicalDeviceTunnel = { tunnelIp: string | null }— one shape, so no discriminator to carryresolveRunnerTransport→resolveTunnel, which is what it now does; the old name advertised a decision this seam no longer makesBehaviour is unchanged: every path that ran before runs the same way. This removes a false affordance rather than a feature — the interface implied XCTest devices resolve a transport, when the transport question was settled upstream.
Testing
The one test that exercised the dead path now asserts the rejection instead of a value production never produced, matching its sibling tests for the other unsupported XCTest operations.
physical-device-controlandrunner-transportsuites pass (19 tests); typecheck and lint clean.On the gate run
check:affectedreports failures inhelp-conformance-bench,install-source(unzip exited with code 9),owner-identity,device-claimsandandroid-recording. Two of those are assertion failures, which I would normally treat as blocking rather than flake — so I checked rather than assumed: all 51 of those tests pass in isolation, both with and without this change, and none of them are reachable from a diff that touches only Apple physical-device control, the Apple route resolver, and one Apple test. The host has been driving real devices and xcodebuild for hours;unzipfailing with a subprocess code and a process-liveness check flipping are both load-sensitive.Worth a separate look if they recur on a quiet machine — I would rather flag that than bury it.