fix(tool-server): cap concurrent simctl device listing#480
Open
iroiro147 wants to merge 2 commits into
Open
Conversation
Signed-off-by: iroiro147 <sarthak.singh@juspay.in>
hubgan
reviewed
Jul 9, 2026
hubgan
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for taking the time to work on this. I appreciate the contribution. There are a few areas that need some additional refinement before this is ready to merge.
Signed-off-by: iroiro147 <sarthak.singh@juspay.in>
Author
|
Thanks for the detailed review, Hubert. I pushed a follow-up commit that reworks the simctl-list lock handling around explicit ownership metadata. What changed:
Re-ran:
|
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
Fixes #327.
Adds a host-wide filesystem lock around local
xcrun simctl list devices --jsonso multiple Argent tool-server processes do not spawn concurrent CoreSimulator discovery calls. BothlistIosSimulators()and the simulator watcher now sharereadSimctlDevices().The lock path also handles the two race cases found during review:
mtimeMsfallback.cleanuplock so competing stale cleaners cannot delete a fresh holder's lockTests
npm test -w @argent/tool-server -- --run test/ios-devices-runtime-kind.test.ts test/list-devices-deadline.test.ts test/simulator-watcher-init-failure.test.ts test/list-devices.test.tsnpm run buildnpm run build -w @argent/tool-servernpm run typecheck:tests -w @argent/tool-servernpm run lint -- --no-warn-ignored packages/tool-server/src/utils/ios-devices.ts packages/tool-server/src/utils/simctl-config.ts packages/tool-server/src/utils/simulator-watcher.ts packages/tool-server/src/tools/devices/list-devices.ts packages/tool-server/test/ios-devices-runtime-kind.test.ts packages/tool-server/test/list-devices-deadline.test.ts packages/tool-server/test/simulator-watcher-init-failure.test.tsnpx prettier --check packages/tool-server/src/utils/ios-devices.ts packages/tool-server/src/utils/simctl-config.ts packages/tool-server/src/utils/simulator-watcher.ts packages/tool-server/src/tools/devices/list-devices.ts packages/tool-server/test/ios-devices-runtime-kind.test.ts packages/tool-server/test/list-devices-deadline.test.ts packages/tool-server/test/simulator-watcher-init-failure.test.tsgit diff --checkNote: I did not use the full
@argent/tool-serverVitest suite as a local gate because this environment blocks several unrelated socket/process-list tests withlisten EPERM/ host-tool permission errors. The focused tool-server slice above is clean.