Repository navigation
fix(ios): allocate unique MJPEG ports for recording sessions - #2066
Merged
saikrishna321 merged 1 commit intoNov 23, 2026
Merged
saikrishna321 merged 1 commit into
saikrishna321 merged 1 commit into
Conversation
|
Azure Pipelines: Some pipeline(s) encountered errors during trigger evaluation. |
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.
Concurrent iOS session creation can interrupt a recording and reconnect it to another device's MJPEG stream. The resulting MP4 can still decode successfully and have approximately the expected duration while showing the wrong device.
The live-streaming removal in #2056 also removed iOS MJPEG port allocation. Screen recording still consumes MJPEG, so sessions without an assigned port fall back to
9100.iOSCapabilitiesalso removes a client-suppliedappium:mjpegServerPortfromalwaysMatch.This change allocates a separate MJPEG port for each iOS session using the existing
getFreePort(options.portRange)helper, passes it to XCUITest, and stores it on the allocated device so the existing cleanup paths can release it. Six regression tests cover real devices and simulators, shared client-supplied ports, concurrent allocation, persistence, and the configured port range.Reproduction and comparison
df:options: {recordVideo: true}. Do not supplymjpegServerPortordf:name.Compared the same baseline and baseline plus this five-line production change on iOS 17.3.1 and 26.1, with two simultaneous-start rounds per variant:
9100An additional control with sequential session creation and overlapping recordings passed on both variants. All 12 MP4 files across the controls and simultaneous-start tests passed full decoding; decoding alone did not detect the wrong-device recordings.
Both arms used the same XCUITest 12.15.0 installation, including an existing local recording-timestamp adjustment. Driver source and compiled-file hashes were unchanged throughout the comparison. This test isolates the Device Farm change; it does not establish a general fix for shortened video duration.
Validation
git diff --checkpassed.The existing second port-forwarding attempt in the plugin can still log a caught port-in-use warning after XCUITest has forwarded the allocated port; no recording failure resulted from it in this comparison.
Related background: appium/appium#12219 documents the need for separate MJPEG ports during parallel recording.