Repository navigation
[build-tools] Start independent device session setup in parallel - #4490
Closed
szdziedzic wants to merge 2 commits into
Closed
szdziedzic wants to merge 2 commits into
szdziedzic wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4490 +/- ##
==========================================
+ Coverage 72.74% 72.75% +0.02%
==========================================
Files 980 980
Lines 47040 47051 +11
Branches 10168 10171 +3
==========================================
+ Hits 34214 34229 +15
+ Misses 11830 11826 -4
Partials 996 996 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- start_android_emulator: in a device run session (DEVICE_RUN_SESSION_ID is set), start the ffmpeg install in the background when the step starts. It ran after the boot and took about 25 s with apt. The session host still waits for the same install. - start_agent_device_remote_session: start the agent-device daemon (with its tunnel) and the session host (with the web preview) in parallel. The teardown waits for both chains and stops what each one started, which also stops the daemon when its credentials never appear. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
szdziedzic
force-pushed
the
szdziedzic-claude/parallel-session-startup
branch
from
September 29, 2026 14:49
81382c4 to
4edb600
Compare
szdziedzic
changed the base branch from
szdziedzic-claude/warm-ios-runner
to
main
September 29, 2026 14:49
|
✅ Thank you for adding the changelog entry! |
Contributor
Author
|
Closing: we are moving the device run session startup into a single step, so the setup can run in parallel as much as possible. A new PR replaces this one. |
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.
Why
I read the worker logs of 12 simulator sessions from 2026-09-29 (6 iOS, 6 Android). The setup is strictly sequential, but some parts do not depend on each other:
apt install ffmpegffmpegis only needed by expo-device-hub (Android). It does not need the emulator, but it ran after the boot.How
eas/start_android_emulator: whenDEVICE_RUN_SESSION_IDis set (only simulator session jobs have it), startensureFfmpegInstalledOnceAsyncin the background at the start of the step. The call is not awaited, and it never rejects (it catches and logs its own errors).startDeviceSessionHostAsyncstill awaits the same install, which then usually finishes during the boot. Other users of the step (for example Maestro jobs) are not affected.eas/start_agent_device_remote_session: start two chains withPromise.all:finallyblock waits for both chains (Promise.allSettled) before the teardown, becausePromise.allrejects on the first failure while the other chain can still be starting.try.Expected gain (estimates from the logs above, not yet measured with this change):
ffmpegoverlaps the 65–76 s boot.Risks:
aptnow runs during the emulator boot (network, disk, CPU). If it slows the boot, we see it in the step timings.findAvailablePortAsync) while the daemon may bind its own port at the same time. Before, the daemon was already listening. A collision is possible but unlikely.Test Plan
startAndroidEmulator.test.ts:ffmpegstarts before the emulator, and the boot does not wait for it (the mock never settles).ffmpeginstall outside a device run session.startAgentDeviceRemoteSession-orchestration.test.ts:yarn jest-unitfor the changed suites: 25 tests pass.build-toolssuite: 1584 tests pass. Onlyrepack.test.tsfails (3 tests) withspawn yarn ENOENT, both with and without this change. It is a problem of my local setup; the same tests pass in CI.yarn typecheck,oxlintandoxfmtpass.Installed ffmpeg.→Web preview URL, and the stepStart agent deviceuntil ready) with the table above, using the EAS Simulator benchmark harness.🤖 Generated with Claude Code